HTTP Statuses and Errors
HTTP statuses indicate if a request has been successful. The Datawrapper API responses will include standard HTTP statuses including error codes. You can find a great overview of HTTP status codes on https://httpstatuses.com.
To show you an example, the 418
client error is rather funny.
Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
Since the Datawrapper API can not make tea (or coffee) you won't see this error code from its endpoints.
Others like 201 CREATED
are very likely though, for example when creating a chart. Here are some of the status codes the Datawrapper API uses:
Code | Name | Type | Example |
---|---|---|---|
200 | OK | Success | GET requests will return status 200 if everything was OK |
201 | Created | POST requests that create new resources (like a chart) will return with 201 . | |
204 | No Content | PUT requests usually don't return anything since they replace the complete resource. | |
301 | Moved permanently | Redirection | There is 1 permanent redirect where /3 gets redirected to /v3 |
400 | Bad request | Client error | Some invalid data was sent to the server. Additional information may be provided as error message. |
401 | Unauthorised | The API Access Token is invalid and authorisation failed. You can check if the token used has a typo or got revoked at some point. If you can't see it in app.datawrapper.de/account, it won't work. | |
403 | Forbidden | You don't have access to the requested resource. | |
404 | Not found | The requested resource was not found. | |
409 | Conflict | There is a conflict with the target resource. This can happen if you try to create a resource with a unique identifier that already exists. |
If you see any statuses in the 5xx
(eg. 500 Internal server error
) range, we probably did something wrong and this is a bug. It could be that the server is unavailable. Please contact us [email protected] in this case.
Updated over 5 years ago