REST API: GET destination/message errors (Marketing Suite)

Each emailing is tracked, which allows Copernica to provide you with emailing statistics. Errors are one of these statistics. You can retrieve all errors for a specific destination by sending an HTTP GET call to the following URL:{$destinationID}/errors?access_token=xxxx

This method also support the use of the fields parameter for the timestamp field.

Note: The terms 'destination' and 'message' can be used interchangeably in this article, including the code examples.

Returned fields

The method returns a JSON object with several errors under the 'data' property. For each error the following information is available:

  • ID: The ID of the error.
  • mailing: The ID of the mailing.
  • timestamp: The timestamp of the error.
  • status: The status of the error.
  • errorcode: The code associated with this error.
  • description: A description of the error.
  • errortype: The type of error this was recognized as.
  • destination: The ID of the destination that caused an error.
  • profile: The ID of the profile that caused an error.
  • subprofile: The ID of the subprofile that caused an error.

JSON example

A single error might look something like this:

   "timestamp":"2015-03-09 15:36:39",
   "description":"No valid from address is set",

PHP example

This script demonstrates how to use this API method:

// dependencies

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 2);

// execute the call

This example requires the REST API class.

More information