Chargetrip Tile Service with React Native and Mapbox
An introduction to the Chargetrip Tile Service and the caveats of integrating it into a React Native mobile application.Read more
To ensure you can respond appropriately when our API gives unexpected output, we maintain a consistent set of API response and error codes. The general design of these will be discussed inside this chapter.
The request succeeded. The client can read the body.
The request is created. A new resource will be created.
The request is accepted. The client has to wait until it’s done processing.
The request has succeeded but returns no message body.
The request could not be understood by the server due to malformed syntax.
The request requires authentication.
The server understood the request, but is refusing to fulfill it.
The requested resource could not be found.
Too Many Requests.
Internal Server Error. If you catch one, report your issue here.
Apart from the response codes, unsuccessful responses return their generic GraphQL error described here alongside some additional fields. The additional fields can be found inside the extensions object. The most important one here is the exception object. This contains all the information about the error and looks as follows;
Your project id with the corresponding configuration
The status code of the response reflecting the API response codes
The message describing the error
A unique error code that can be used for localization
If we want to reflect this as a curl it would look like this;
"message": "The car was not found in the database",
"message": "No car was found with the provided ID",
Navigate to our API reference to get a more detailed look at the possible errors per request.