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

User sends request for report

async/getCampaignDeliveryStats – request for delivery report

URL to call the method
https://api.unisender.com/ru/api/async/getCampaignDeliveryStats
Arguments
api_key *API access key.
campaign_id *Campaign identifier received when calling the createCampaign method.
notify_url *The URL to which the response will be sent after the report is generated.
changed_sinceReturn all address statuses that have changed since the specified time inclusive (in the format “YYYY-MM-DD hh: mm: ss”, UTC time zone). If the argument is missing, all statuses are returned.
field_idsArray id additional fields. The transfer method using HTTP is: field_ids [] = 1 & field_ids [] = 2. The id values can be obtained using the getFields. method. If specified, the values of additional fields associated with the contact are added to the result.
Return value
JSON object with the following fields:
{
  "result":{
    "task_uuid": "ff719cf2-4ed9-11e9-8647-d663bd873d93",
    "status": "new",
  }
}
task_uuidUnique identifier of the data preparation task.
statusThe status of the task.

The system prepares data

Depending on the number of recipients in the list, a report on it may be prepared for some time. After the report is ready, it will be sent to the URL specified in the notify_url parameter of the async/getCampaignDeliveryStats method.

You can also request task status:

Request task status

async/getTaskResult – get task status

URL to call the method
https://api.unisender.com/ru/api/async/getTaskResult
Arguments
api_key *API access key.
task_uuid *ID of the request for the preparation of the report, received when calling the async/getCampaignDeliveryStats method.

If the task is still running:

Return value
JSON object with the following fields:
{
  "result":{
    "task_uuid": "ff719cf2-4ed9-11e9-8647-d663bd873d93",
     "task_type": "getCampaignDeliveryStats",
     "status": "processing"
  }
}
task_uuidUnique identifier of the data preparation task.
task_typeType o task for preparing data.
The getTaskResult method is universal and suitable for methods that use data preparation. The parameter returns the name of the method by which the task is prepared. In this case, the async/getCampaignDeliveryStats method is returned.
statusThe status of the task.

If the task has already been completed:

Return value
JSON object with the following fields:
{
  "result":{
        "task_uuid": "ff719cf2-4ed9-11e9-8647-d663bd873d93",
        "task_type": "exportContacts",
        "status": "completed",
        "file_to_download": "[URL to AWS]"
  }
}
task_uuidUnique identifier of the data preparation task.
task_typeType o task for preparing data.
The getTaskResult method is universal and suitable for methods that use data preparation. The parameter returns the name of the method by which the task is prepared. In this case, the async/getCampaignDeliveryStats method is returned.
statusThe status of the task.
file_to_downloadLink to download the file.

The system sends the user a notification with a link to the requested data

After completing the data preparation task, the system sends the Webhook user to the specified URL (notify_url parameter)

Sent notification
JSON object with the following fields:
{
  "result":{
        "task_uuid": "ff719cf2-4ed9-11e9-8647-d663bd873d93",
        "task_type": "exportContacts",
        "status": "completed",
        "file_to_download": "[URL to AWS]"
  }
}
task_uuidUnique identifier of the data preparation task.
task_typeType o task for preparing data.
The getTaskResult method is universal and suitable for methods that use data preparation. The parameter returns the name of the method by which the task is prepared. In this case, the async/getCampaignDeliveryStats method is returned.
statusThe status of the task.
file_to_downloadLink to download the file.

Examples of forming the URL request

https://api.unisender.com/ru/api/async/getCampaignDeliveryStats?api_key=KEY
— request for delivery report.