Errors

The Sway Charts REST API relies on the standard HTTP status codes for communicating errors. Codes in the range of 400-499 indicate an error on the client side which can be fixed by amending the request and re-trying. Codes in the range of 500-599 indicate a server-side error.

The Sway Charts REST API does not use any custom status codes. Each error is reported via the status code; the response body includes an internal error code (if applicable) as well as the error description.

Application level errors are reported in a response as special "error" objects containing the following data:

  • errorCode: Error code; distinct for different distinct errors

  • description: Human-readable description of the issue (in English; subject to change without changes in API version)

// JSON

{
    "errorCode": "153",
    "description": "Description"
}
// XML

<error>
    <errorCode>153</errorCode>
    <description>Description</description>
</error>

The following errors may be triggered by any resource of the API:

  • Request comes from the non-authenticated client

    • Status code: 401 Unauthorized

    • Error code: 1

    • Description: Authorization required

  • Malformed HMAC signature (HMAC authentication failed due to malformed HMAC signature header. See HMAC auth)

    • Status code: 400 Bad Request

    • Error code: 11

    • Description: Malformed HMAC signature

  • HMAC signature too old (more than a permitted amount of time passed since the request was created. See HMAC auth)

    • Status code: 401 Unauthorized

    • Error code: 12

    • Description: HMAC signature too old

  • HMAC signature mismatch (HMAC signature check failed; authentication failed. See HMAC auth)

    • Status code: 401 Unauthorized

    • Error code: 13

    • Description: HMAC signature mismatch

Last updated