Status Codes
Handle successful and error results in the Zyllem API
The Zyllem API will return different HTTP status codes depending on the outcome of the request. Your API client is expected to check those status codes and react accordingly.
200 - OK
A successful request will always return the status code 200
.
The content of the response body depends on the resource operation, please refer to the API reference for more details.
401 - Unauthorized
If something is wrong with your API key, the API will return the status code 401
.
Check the Authorization 101 section for detailed instructions on how to troubleshoot these errors.
{
"message": "Invalid API key"
}
{
"message": "Missing API key"
}
400 - Bad Request
When a request is invalid due to a client issue, the API will return the status code 400
.
This response code indicates that there is something wrong with your request and that you need to modify it and try again. A typical example is a field validation error during a POST
operation (ex: a mandatory field is missing in the request body).
The response will contain the following information:
message
(always present) A general error messagevalidationErrors
(optional) A list of errors on specific properties submitted for the request. WhenvalidationErrors
are sent, aproperty
field containing the path to the failing property is provided together with amessage
describing the issue
{
"message": "Validation errors",
"validationErrors": [
{
"property": "origin.processingTimeSeconds",
"message": "The field ProcessingTimeSeconds must be between 0 and 1000000."
},
{
"property": "destination.cashCollection.amount",
"message": "The field Amount must be between 0 and 1000000000."
},
{
"property": "destination.cashCollection.currency",
"message": "The Currency field is required."
},
{
"property": "lineItems[0].code",
"message": "The Code field is required."
}
]
}
{
"message": "Missing item",
"validationErrors": [
{
"property": "itemId",
"message": "Cannot find item with id '5d1c09379b726b757c85d41e'"
}
]
}
500 - Internal Server Error
When a request is invalid due to a server issue, the API will return the status code 500
.
You should generally not receive such response but in the unlikely event that this happens, try submitting your request again. If the problem persists you may contact a Zyllem admin and communicate the code provided in the response. Notice that the Zyllem team is proactively monitoring those errors.
{
"message": "Internal Server Error",
"code": "5d1c27ae9b726b53846d97c1",
"moreInfo": "If the error persists, please contact a Zyllem admin and indicate the code above"
}
Updated over 5 years ago