REST API: GET scheduledemailing (Publisher)

A scheduled emailing is an emailing that is scheduled to be sent in the future. Its start date can lie in the future as well as the past, as it can be sent multiple times. This method retrieves a scheduled emailing sent with Publisher. The method sends an HTTP GET request to the following address:$id?access=token=xxxx

The $id should be replaced with the ID of the scheduled emailing you want to retrieve. You can find the method to retrieve all of the scheduled Publisher mailings here.

Returned fields

This method returns a JSON object with the scheduled emailing. The emailing contains the following fields:

  • id: The ID of the scheduled emailing.
  • next: The timestamp of the next mailing (YYYY-MM-DD HH:MM:SS format).
  • previous: The timestamp of the previous mailing (YYYY-MM-DD HH:MM:SS format).
  • interval: An array for the time interval indicating the 'count' and the 'unit'.
  • iterations: The total number of times the mailing will be sent, or -1 for infinite mailings.
  • processed_iterations: The total number of times the mailing has been sent.
  • scheduled_iterations: The total number of times the mailing will be sent in the future, or -1 for infinite mailings.
  • document: The ID of the document used for this mailing.
  • template: The ID of the template used for this mailing.
  • subject: The subject of the mailing.
  • from_address: An array containing the 'name' and the email address ('email') of the sender.
  • testgroups: The number of testgroups used in this mailing.
  • emailing_type: Type of the mailing (splitrun, A/B test, normal).
  • contenttype: Type of content in this mailing; 'html', 'text' or 'both'.
  • target: Contains the target of the mailing and the ID and the types of the entities it is structured under (for example the database a collection belongs to).

JSON example

The JSON object representing the emailing will look something like this:

    "next":"2020-01-01 00:00:00",
    "previous":"2020-01-02 00:00:00",
    "subject":"Your daily reminder",
            "name":John Doe,

PHP Example

The following script demonstrates how to use this method.

// required scripts

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

// execute the request and print the result

The example above requires the CopernicaRestApi class.

More information