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.|
|Server successfully processed the request, and is not returning any content.|
|Server cannot process the request. More info in response.|
|Proper authorization is required to access this resource.|
|Access to the requested resource is forbidden|
|Resource is not found.|
|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.|
In POST or PUT query - validation errors may occur. Details about them are placed in "details" attribute.
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.