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, also in the X-Request-Id header. null when the response did not come from the API itself (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, 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 | internal_error | Something went wrong on our side. | Yes, with backoff. |
503 | unavailable | The report took too long to produce. | 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 API response 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
A few responses are sent before the request reaches the API. The most common is a 429 for a rate limit. These can have a different body or no X-Request-Id. When they use the error shape, request_id is null. Always check the HTTP status first.
Retries
- Retry
429,500, and503with 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.