Whenever we call your API and there's a problem, we can try and handle this error gracefully.
HTTP status codes 401
and 403
are assumed to be caused by an invalid token.
On other status codes between 400
- 500
we'll show "There was a problem with the {partner.name} API". You can send a message that will be shown to the user in the response body, e.g.:
GET {partner.urls.send_assessment} HTTP/1.1
Content-Type: application/json
Status: 402
{"error": "No credits left"}
![error-validate-token.png 1090](https://files.readme.io/edb42b0-error-validate-token.png)
![error-tests.png 2240](https://files.readme.io/b296e3d-error-tests.png)
![error-send-assessment.png 1108](https://files.readme.io/fb78c3c-error-send-assessment.png)