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 CodeStatus LineDescription
200OKSuccessful request.
301Moved PermanentlyThe resource has moved to a new location permanently.
302Moved TemporarilyThe resource has moved to a new location temporarily.
400Bad RequestThe 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.
401UnauthorizedThe request requires a valid session. Login via the login API and include the session-token cookie or header with the request.
403ForbiddenThe account does not have sufficient permission to access the resource.
404Not FoundThe resource / API endpoint does not exist.
405Method Not AllowedThe resource / endpoint exists but the HTTP verb (GET, POST, PUT, DELETE) is not valid for this endpoint.
500Internal Server ErrorAn error has occurred processing the request on the Matchbook servers.
502Bad GatewayA server error (possibly a timeout) has occurred processing the request on the Matchbook servers.
503Service UnavailableThe service is temporarily unavailable due to a technical problem.
504Gateway TimeoutA 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>