Arbebus API

Klaidos ir retry

Vienodas klaidų formatas, stabilūs kodai ir saugus pakartotinių užklausų valdymas.

Klaidos formatas

{
  "error": {
    "code": "API_KEY_INVALID",
    "message": "API key is invalid.",
    "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  }
}

Kiekviena gateway klaida grąžina X-Arbebus-Request-Id antraštę ir tą patį requestId kūne.

Stabilūs kodai

KodasReikšmė
INVALID_REQUESTNeteisinga užklausa
METHOD_NOT_ALLOWEDNepalaikomas metodas
ROUTE_NOT_FOUNDNežinomas maršrutas
UNSUPPORTED_MEDIA_TYPENetinkamas Content-Type
PAYLOAD_TOO_LARGEPer didelis body
AUTHORIZATION_REQUIREDTrūksta Authorization
AUTHORIZATION_MALFORMEDNeteisingas Authorization
API_KEY_INVALIDRaktas neteisingas
API_KEY_REVOKEDRaktas atšauktas
API_KEY_EXPIREDRaktas pasibaigęs
API_KEY_ENVIRONMENT_MISMATCHAplinkos nesutapimas
API_KEY_SCOPE_DENIEDTrūksta scope
PROJECT_UNAVAILABLEProjektas neprieinamas
ORGANIZATION_UNAVAILABLEOrganizacija neprieinama
RATE_LIMIT_EXCEEDEDPer-minute abuse RPM exceeded
QUOTA_EXCEEDEDCumulative technical sandbox quota exceeded
IDEMPOTENCY_KEY_INVALIDIdempotency-Key empty, oversized, or contains control characters
IDEMPOTENCY_CONFLICTSame Idempotency-Key with a different request fingerprint
IDEMPOTENCY_IN_PROGRESSConcurrent duplicate still processing
ORIGIN_NOT_ALLOWEDOrigin not allowed
INTERNAL_ERRORInternal error

HTTP codes

CodeMeaningAction
400Invalid requestFix parameters
401Authentication errorCheck key
403Authorization errorCheck scope / status
404Route not foundCheck URL
405Method not allowedUse Allow
409Idempotency conflict / in progressDo not change body for same key; wait or use a new key
413Payload too largeReduce body
415Media typeUse application/json
429Rate limit or technical quotaInspect error.code: RATE_LIMIT_EXCEEDED vs QUOTA_EXCEEDED
500/503Server errorRetry with backoff

Retry strategija

Naudokite eksponentinį laukimą su atsitiktine paklaida. Nekartokite 400, 401, 403 ir 404 užklausų automatiškai.

Pagalba

Kreipdamiesi į palaikymą pridėkite requestId, laiką, endpoint’ą ir projekto identifikatorių. Nesiųskite pilno slapto API rakto.