Error Objects

Error List Object

{
  "type": "error.list",
  "errors": [
    {
      "code": "not_found",
      "message": "No such user_id[314159]",
      "field": "user_id"
    },
    {
      "code": "not_found",
      "message": "No such email[pi@example.org]",
      "field": "email"
    }
  ]
}
// the JavaScript client doesn't directly expose error data
# the Ruby client doesn't directly expose error data
<?php
// the PHP client doesn't directly expose error data
?>
try {
  UserCollection uc = User.list();
} catch(IntercomException  ie) {
  Error e = ie.getFirstError();
  log.error("{}:{}", e.getCode(), e.getMessage());
}

The API will return an Error List for a failed request, which will contain one or more Error objects.

Error List Attributes

Each error has the following attributes

FieldDescription
typeThe type is error.list
errorsAn array of one or more error objects

Error Object Attributes

Each Error Object has the following attributes

FieldDescription
codeA string indicating the kind of error, used to further qualify the HTTP response code
messageOptional. Human readable description of the error
fieldOptional. Used to identify a particular field or query parameter that was in error.