Error Handling
The Matchbook API uses standard HTTP status codes to indicate successful or error responses. The most common status codes are listed below.
Status Code | Status Line | Description |
---|---|---|
200 | OK | Successful request. |
301 | Moved Permanently | The resource has moved to a new location permanently. |
302 | Moved Temporarily | The resource has moved to a new location temporarily. |
400 | Bad Request | The request was rejected. This could indicate missing headers or fields, a badly formatted request body or that some condition of the system did not permit the request such as sending a submit offers request to try and bet on a closed market. |
401 | Unauthorized | The request requires a valid session. Login via the login API and include the session-token cookie or header with the request. |
403 | Forbidden | The account does not have sufficient permission to access the resource. |
404 | Not Found | The resource / API endpoint does not exist. |
405 | Method Not Allowed | The resource / endpoint exists but the HTTP verb (GET, POST, PUT, DELETE) is not valid for this endpoint. |
500 | Internal Server Error | An error has occurred processing the request on the Matchbook servers. |
502 | Bad Gateway | A server error (possibly a timeout) has occurred processing the request on the Matchbook servers. |
503 | Service Unavailable | The service is temporarily unavailable due to a technical problem. |
504 | Gateway Timeout | A timeout has occurred processing the request on the Matchbook servers. |
In addition to the status code error responses will also include a response body containing more detailed information e.g.
{
"errors": [{
"messages": ["Username or password are incorrect."]
}]
}
<response>
<errors>
<error>
<messages>Username or password is incorrect.</messages>
</error>
</errors>
</response>