Errors
The Partner API error format, every error code, request IDs, and which errors to retry.
Every API error has the same JSON shape:
{
"error": {
"code": "not_found",
"message": "Not found",
"request_id": "c0ffee00-0000-4000-8000-000000000000"
}
}| Field | Meaning |
|---|---|
error.code | A code for your program. Branch on it, or on the HTTP status. |
error.message | A message for people. The wording can change, so do not parse it. |
error.request_id | This request's ID. API responses also send it in the X-Request-Id header. It can be null (see responses from outside the API). |
Error codes
| Status | Code | Meaning | Retry? |
|---|---|---|---|
400 | invalid_request | A parameter is invalid: a bad date or date range, an unknown or repeated parameter, or a cursor reused with different parameters. The message names the parameter. | No. Fix the request. |
401 | unauthorized | The token is missing, malformed, unknown, revoked, or expired. | No. Check the token. |
403 | forbidden | The token does not have the required scope (the message names it), or your organization cannot use this endpoint. | No. |
404 | not_found | The path or publisher does not exist, or your token cannot see it. | No. |
405 | method_not_allowed | The path does not accept this method. The Allow header lists the methods it accepts. | No. |
429 | rate_limited | Too many requests. See rate limits. | Yes, after Retry-After or with backoff. |
500, 502 | internal_error | Something went wrong on our side. | Yes, with backoff. |
503 | unavailable | The report took more than about 20 seconds to produce, or the request timed out. | Yes, with backoff, or ask for less data. |
We may add codes. Handle an unknown code by its HTTP status: retry a 5xx with backoff, and do not retry a 4xx other than 429.
Request IDs
Every response from the API has an X-Request-Id header, and error bodies repeat it in error.request_id. Log it with every failure. Quote it when you contact support@getinline.io so we can find the request.
Responses from outside the API
Some responses are sent before the request reaches the API. They have no X-Request-Id header:
- A rate-limit
429from our firewall hasrequest_id: nullandRetry-After: 300. - Errors from our API gateway, such as a
429when the whole API is busy (Retry-After: 1) or a502, have arequest_idin the body. Quote it to support.
Always check the HTTP status first.
Retries
- Retry
429and every5xxwith exponential backoff and jitter: for example, after 1, 2, 4, then 8 seconds, up to a limit. If a429has aRetry-Afterheader, wait that many seconds instead. - Do not retry any other
4xxwithout changing the request. - If a report keeps returning
503, ask for fewer days or onepublisher_id. See revenue report errors.