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

HeaderPurpose
Retry-AfterPolling/rate-limit/backpressure guidance
X-RateLimit-LimitWindow request limit
X-RateLimit-RemainingRemaining requests
X-RateLimit-ResetWindow reset time
ETag / If-MatchOptimistic concurrency for mutable resources
LocationCreated/asynchronous resource URI

03

Chính sách retry

ClassRetry?Client behavior
401/403 auth or scopeNo automatic retryRefresh credentials or correct authorization
409 idempotency/state conflictConditionalRead resource and reconcile state
422 policy/validationNoCorrect request/profile
429 rate limitYesHonor Retry-After
502/503 provider unavailableConditionalBackoff; do not duplicate protected operation
504 timeoutRead before retryResolve resource by idempotency key/correlation