7th May 2021

API Errors

The API will return all errors as JSON objects with a message property and optionally an errors array. The format is the same as that described by JSON API.

Examples

Here are some common error messages that you might meet.

Signature errors

Status code: 400

If you are creating your own client for the Integration or Management API, implement the request signing algorithm detailed in Integration API Authentication or Management API Authentication.

{
  "message": "HMAC signature mismatch."
}

Validation errors

Status code: 400

By far the most common error is validation errors of request payloads or parameters.

If you send a customer profile update with an unknown profile attribute MyAttribute, you receive the an error object with the following content:

{
  "message": "The submitted data was invalid",
  "errors": [
    {
      "title": "Unknown",
      "details": "The attribute \"MyAttribute\" is not defined on CustomerSession entities.",
      "source": {
        "pointer": "/attributes/MyAttribute"
      }
    }
  ]
}

The source.pointer property of the first argument is a JSON pointer to the invalid data in the payload.

If you send the wrong data type for an attribute, you receive a similar response:

{
  "message": "The submitted data was invalid",
  "errors": [
    {
      "title": "Invalid type",
      "details": "Value of \"Name\" attribute (false) is not a string",
      "source": {
        "pointer": "/attributes/Name"
      }
    }
  ]
}

Or sending an invalid state in a customer session update:

{
  "message": "The submitted data was invalid",
  "errors": [
    {
      "title": "enum",
      "details": "state must be one of the following: \"open\", \"closed\", \"cancelled\"",
      "source": {
        "pointer": "/state"
      }
    }
  ]
}

In any validation error related to a request payload, look first to the source.payload pointer and the details to determine the issue.

Still need help? Get in touch!
Last updated on 7th May 2021

Was this article helpful?

Thank you! You have already voted

If you’d like a member of our support team to respond to you, please send a note to support@talon.one