Poussée mobile
Expérience mobile facilement perceptible et consommable.
If an API request is unsuccessful, you will encounter errors in the form of HTTP response codes. The types of error codes can be either client-related or server-related, and they can be generic or customised for Advantus.
A list of common error responses along with their explanation is given below:
HTTP Status Code | Status | Definition |
---|---|---|
400 | Bad Request | Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing) |
401 | Unauthorized | This response status code indicates that the client request has not been completed due to invalid authentication credentials for the requested resource. |
403 | Forbidden | This response status code indicates that the server understands the request but refuses to authorize it. |
404 | Not Found | This response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot. A 404 status code only indicates that the resource is missing: not whether the absence is temporary or permanent. |
405 | Method Not Allowed | 405 Method Not Allowed error occurs when the web server is configured in a way that does not allow you to perform a specific action for a particular URL. |
500 | Internal Server | This response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. |
502 | Bad Gateway | This response code indicates that the server while acting as a gateway or proxy, received an invalid response from the upstream server. |
503 | Service Unavailable | This response code indicates that the server is not ready to handle the request. Common causes include a server that is down for maintenance or that is overloaded. |
Advantus leverages HTTP-based codes that are received in response to any API calls made throughout the application.
These code responses can be of various types:
An easy way to understand them is-
This document will guide you through a basic structure of responses. Some responses will have a brief explanation along with them in the form of a string code.
However, there may be certain exceptions to the rule, based on specific code libraries that generate their own error responses.
Attribute | Explanation | Datatype |
---|---|---|
success | This will return true or false | boolean |
message | A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. | string |
error_code | For some errors that could be handled programmatically, a short string indicating the error code is reported. | integer |
data | This will return data | object |