VẬN HÀNH API

Lỗi, retry, giới hạn tốc độ và timeout

Lỗi máy đọc có type ổn định, hướng khắc phục và hành vi retry rõ ràng.

01

Chi tiết lỗi

{
  "type": "https://quantumsafe.mobile-id.vn/problems/signing-profile-not-allowed",
  "title": "Signing profile is not allowed",
  "status": 422,
  "detail": "The requested profile is not approved for this tenant and CA route.",
  "instance": "/v1/signing-requests/sr_...",
  "correlationId": "...",
  "retryable": false
}

02

Header vận hành

HeaderMục đích
Retry-AfterHướng dẫn polling/rate-limit/backpressure
X-RateLimit-LimitGiới hạn yêu cầu trong window
X-RateLimit-RemainingSố yêu cầu còn lại
X-RateLimit-ResetThời điểm reset window
ETag / If-MatchOptimistic concurrency cho tài nguyên có thể thay đổi
LocationURI tài nguyên được tạo/bất đồng bộ

03

Chính sách retry

NhómRetry?Hành vi client
401/403 auth or scopeKhông tự động retryLàm mới credential hoặc sửa authorization
409 idempotency/state conflictCó điều kiệnĐọc tài nguyên và đối soát trạng thái
422 policy/validationKhôngSửa request/profile
429 rate limitTuân theo Retry-After
502/503 provider unavailableCó điều kiệnBackoff; không lặp lại thao tác được bảo vệ
504 timeoutĐọc trước khi retryGiải quyết tài nguyên bằng idempotency key/correlation