REST API: GET testgroups (Publisher mailing)

You can retrieve the test groups of a Publisher mailing by sending an HTTP GET request to the following URL:$id/testgroups

Where the $id should be replaced with the ID of the mailing.

Returned fields

The data field of returned JSON object contains the test groups. The following fields are available for each test group:

  • ID: The ID of the testgroup
  • document: The ID of the document of the mailing.
  • template: The ID of the template of the mailing.
  • name: The name of the mailing snapshot sent to this group.
  • from_address: The 'from address' of the mailing.
  • subject: The subject of the mailing.
  • timestamp: The timestamp of the mailing.
  • destinations: The number of destinations in this group.

JSON example

The JSON for a testgroup might look something like this:

   "name":"Testgroup 1",
   "from_address":"\"Mr. Test\" <>",
   "timestamp":"2010-10-12 12:37:26",

PHP example

The following script demonstrates how to use this API method:

// dependencies

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

// execute the call

This example requires the REST API class.

More information