Ship X API is the main interface for exchanging data with the central system.
Access to data is protected, authorization mechanism is based on OAuth 2.0 standard.
Requests are authenticate by Bearer token. API is stateless interface.
HTTP Status codes
List of HTTP status codes which may occurs in response:
|HTTP status code||Description|
|New resource is created.|
204 NO CONTENT
|Server successfully processed the request, and is not returning any content.|
400 BAD REQUEST
|Server cannot process the request. More info in response.|
|Proper authorization is required to access this resource.|
|Access to the requested resource is forbidden|
404 NOT FOUND
|Resource is not found.|
500 SERVER ERROR
|The server failed to fulfil a request|
If error occurs, API will return object with following attributes:
|Integer||HTTP status code|
Easy to understand description of error.
It may change - do not base on it in your code.
|Object||Details of the error which occurred.|
HTTP/1.1 404 Not Found
"message": "Resource you are looking for are not found",
In POST or PUT query - validation errors may occur. Details about them are placed in "details" attribute.
HTTP/1.1 400 Bad Request
"message": "Data sent by POST or PUT request are not valid. Check details for more info",
"name": ["required", "too_short"],
Names of attributes with validation errors are keys for details object. Their value is a table with error keys which occured. Error keys are described below.
The table below shows the error keys that may occurs with possible HTTP codes.
|Error key||HTTP Code||Description|
|The resource you are looking for was not found|
There were validation errors when sending data via POST or PUT. More info in "details".
Access to the resource is impossible due to lack of or incorrect access token.
Access to the specified resource is denied due to lack of or incorrect permissions.
Validation error keys
The table below shows the validation error keys that may occurs in details attribute if validation is failed.
|Value is required.|
|Value is invalid, more info in resource documentation.|
|Value is too short, more info in resource documentation.|
|Value is too long.|
|Value is too small, it concerns to numerical value. |
|Value is too big, it concerns to numerical value. |
Given value has an invalid format, e.g word in phone number field.
Besides to the above errors, there may be others, for specific resources. More details in documentation specific to these resources.