HTTP Status Codes and Error Types

Snappy uses standard HTTP status codes for each API’s response.

Status codes are divided into the following five categories:

  • 1xx: Informational - Communicates transfer protocol-level information.
  • 2xx: Success - The request was successful.
  • 3xx: Redirection - The client must take some additional action to complete the request.
  • 4xx: Client Error - Failed request due to client error.
  • 5xx: Server Error - Failed request due to server error.

400 Bad Request

A 400 Bad Request error means that the server was unable to proceed with the request. The most common cause of the error is bad syntax in the request URL or body. To fix a 400 Bad Request error, do the following:

  • Check that the request URL is valid including all query parameters and their values.
  • Check API examples.
  • Check the specific error code and the error message for more information.

401 Unauthorized

401 Unauthorized errors are usually caused by a problem in your authorization credentials passed in the header of your API request. Some common cases are:

Error TypeFix
Unknown authentication schemaUnrecognized authentication header schema. Make sure the authentication header follows the format:
X-API-Key: (your api key)
Missing authenticationThe authentication/x-api-key header is missing or empty. Make sure the authentication header follows the format:
X-API-Key: (your api key)
Invalid token/keyIncorrect token/key, make sure you passed the correct token/key.
Expired token/keyThe token/key has expired

403 Access Denied

After you have been authorized with your token/key, Snappy checks if you have permission to access the specific resource. If the token does not have the correct permissions, a 403 Access Denied error is returned. When this happens, check the following:

  • Make sure you passed the requested resource id correctly
  • Make sure you have access to the specific resource within your company

404 Resource Not Found

This error occurs when you try to call an API or fetch an entity that does not exist. For example, calling /v2/gift/{giftId} (single form) instead of /v2/gifts/{giftId} for getting a specific gift.

In some cases, when you don’t have an access to a specific entity you might receive the 404 Resource Not Found status (instead of 403 Access Denied). Check carefully the entity id you are passing, if you are sure you're passing the correct id and the issue persists, contact Snappy.

500 Internal Server Error

A 500 Internal Server Error indicates that Snappy is experiencing an internal error. If you continue to receive server errors check the Snappy API availability page and contact us with the following data:

  • Request: url, method, header , body.
  • Response: header, errorCode (if available).

Note: in rare cases 500 Internal Server Error might return in a different format than defined above, but the status code will always be the same.

504 Gateway Timeout

A 504 Gateway Timeout error happens when processing your API, takes too long for Snappy. Our services may be occasionally interrupted or temporarily unavailable for reasons outside of our control. Make sure you have proper error handling for such cases.