Documentation

Last update: June 16, 2024

Error handling

The following exception HTTP response codes can be returned.

400 - Bad Request
The request body syntax is not valid.
401 - Unauthorized
User credentials do not match any user.
403 - Forbidden
User credentials were succesfully validated but account lacks the required privileges.
405 - Method Not Allowed
A unsupported method is used.
415 - Unsupported Media Type
A unsupported media type is used.
422 - Unprocessable Content
The request body content is not valid.
429 - Too Many Requests
The request exceeds your rate limit.
500 - Internal Server Error
Catch-all server error.
507 - Insufficient Storage
The request response is too large.

400

Bad request

This response is returned when the syntax validation of the request body fails.

{
    "statusCode": 400,
    "statusText": "Bad Request",
    "detail": "JSON parse error - Expecting ',' delimiter: line 6 column 3 (char 71)"
}

401

Unauthorized

This response is returned in two occasions:

  • No Basic-Auth Authorization header was provided in the request.
  • The provided username and password do not match any existing user.

{
    "statusCode": 401,
    "statusText": "Unauthorized",
    "detail": "Your user could not be authenticated, check if your credentials are correct."
}

403

Forbidden

This response is returned when your account is not authorized to make use of the API.

{
    "statusCode": 403,
    "statusText": "Forbidden",
    "detail": "Your user was correctly authenticated but lacks the required privileges. Check the User Type in your Account Settings."
}

405

Method Not Allowed

This response is returned when the method of the request is not supported.

{
    "statusCode": 405,
    "statusText": "Method Not Allowed",
    "detail": "Method \"GET\" not allowed."
}

415

Unsupported Media Type

This response is returned when the media type of the request is not supported.

{
    "statusCode": 415,
    "statusText": "Unsupported Media Type",
    "detail": "Unsupported media type \"application/octet-stream\" in request."
}

422

Unprocessable Entity

The request is received well, however, the content does not pass validation.
The value path describes where in the message the error is. Incase of an array value, the index of the object is provided indicating which json object in the message contains an invalid value.

{
    "statusCode": 422,
    "statusText": "Unprocessable Entity",
    "detail": "0 is less than or equal to the minimum of 0",
    "valuePath": "items > 44 > height"
}

429

Too Many Requests

Rate limiting of 10 requests per second is enforced on all endpoints, contact Packing Optimizer if you wish to extend this limit.
A 429 response also includes a Retry-After header, indicating how to long to wait before making a new request.

{
    "statusCode": 429,
    "statusText": "Too Many Requests",
    "detail": "You have hit your rate limit."
}

500

Internal Server Error

This response is returned when a generic packing request error is encountered.
Your request will not succeed to be processed, recommended is to contact Packing Optimizer to get your issue resolved.

{
    "statusCode": 500,
    "statusText": "Internal Server Error",
    "detail": "Error executing packing request."
}

507

Insufficient Storage

This response is returned when the packing result message is too large to be transferred.
Your request will not succeed to be processed, recommened is to contact Packing Optimizer to get your issue resolved.

{
    "statusCode": 507,
    "statusText": "Insufficient Storage",
    "detail": "Response of the request is too big."
}