Error Handling
General error format
Most API calls return an error JSON document. The HTTP request is acknowledged with status 200 OK — errors are detected by evaluating the JSON.
json
{
"statuscode": 500,
"statusmsg": "Internal server error",
"additionalstatusmsg": ""
}| Field | Description |
|---|---|
statuscode | Error code (based on HTTP status codes) |
statusmsg | Error message |
additionalstatusmsg | Additional debug information (not for end users) |
HTTP status codes
| Code | Meaning |
|---|---|
200 | Success (or error in the JSON) |
400 | Missing or invalid parameter |
401 | Missing or invalid token, no permission |
404 | Resource not found |
500 | Server error / exception |
Exception: article images
The /articlesimage.jpg endpoint does not return an error JSON; it uses HTTP status codes exclusively for error handling.
Recommended approach
- Always check the HTTP status code
- For
200: check whetherstatuscodeis present in the JSON - Treat
statuscode401 in the JSON like HTTP 401: token invalid or expired → get a new token - Use
additionalstatusmsgfor debugging only; do not show it to end users