Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

getCampaignDeliveryStats method

Вы здесь:

Get a report on the results of the delivery of messages in the given campaign.

Principle of use

Syntax and URL to call the method
getCampaignDeliveryStats (int campaign_id, datetime changed_since)
Example 1: https://api.unisender.com/en/api/getCampaignDeliveryStats?format=json&api_key=KEY&campaign_id=ID &changed_since=DT
Example 2: https://api.unisender.com/en/api/getCampaignDeliveryStats?format=json&api_key=KEY&user_campaign_id=ID &changed_since=DT
Arguments
api_key * API access key.
campaign_id (user_campaign_id – see the note) * Campaign identifier received when calling the createCampaign method.
changed_since Return all address statuses that have changed since the specified time, inclusive (in the “YYYY-MM-DD hh:mm:ss” format, UTC time zone). If the argument is absent, all statuses are returned.
field_ids List of additional id fields separated by commas. The id values can be obtained using the getFields method. If specified, the values of the additional fields linked to the contact are added to the result.
Return value
JSON object with the following fields:
fields Array of field names. It includes at least the email fields (phone for sms-campaigns) and send_result (text identifier of the delivery status). In case of email campaigns, the last_update field is also available, it stores the date and time of the delivery status change in the “YYYY-MM-DD hh:mm:ss” format in UTC If the field_ids parameter is specified, the ID of each of the additional fields submitted are added. See possible results of the send_result field for email here, and for SMS — here (the only difference is in the name of the fields: send_result and status, values from the same set).
data Array of the delivery results. Each result is an array of fields, described in the fields.
Note:
1. * — mandatory parameters.
2. It is possible to send the user_campaign_id parameter instead of the campaign_id input parameter (for more details on the user_campaign_id parameter, see the description of the sendEmail method). If the user_campaign_id argument is used for mailings with different messages, the bursts array will be returned instead of the «letter_id»:»{ID}» parameter in the response, where each element is an object with two fields: the mailing identifier and the message identifier. (

"bursts":[
            {"burst_id":1,"letter_id":2},
            {"burst_id":2,"letter_id":1}
            ]
If there are any errors or warnings, they are returned in the error/warnings fields as described.

Example of the return value:

{
  "result":{
    "letter_id":"5134356",
    "fields":["email","send_result","last_update","1"] ,
    "data":[
      ["one@gmail.com","ok_sent","2011-01-27 09:38:01","name1"]
      ["two@hotmail.com","ok_sent","2011-01-27 09:38:02","name2"]
      ["three@yandex.ru","ok_sent","2011-01-27 09:38:03","name3"]
      ["four@bk.ru","err_will_retry","2011-01-27 09:38:04","name4"]
    ] 
  }
}