Get campaign statistics with paging and filter
GET /campaigns/{CampaignID}/stats/{Type}.{Format}
Retrieves a list of statistics for a specific campaign based on activity such as emails sent, opened, bounced, links clicked, and so on. Because this call can return a large number of results, you can add paging information as input. You have the option to filter the results within a date range.
Request
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| CampaignID | path | string | true | The ID of the campaign that you are fetching statistics for. |
| Type | path | string | false | The type of activity used to get information and display statistics. Possible values are - when and to which recipients the campaign was sent.Opened - who opened the campaign.LinkClicked - who clicked on which links in the campaign.Unsubscribed - who unsubscribed from the campaign by clicking the unsubscribe link and when.Bounced - which email recipients failed to receive the campaign. If not specified, Sent value is used by default.Complained - which email recipients reported your campaign as spam through their email service.Activity - all types of activities for the campaign. |
| Format | path | string | true | The supported file format for getting a response.Possible values:Ā json andĀ xml. |
| apikey | query | string | true | The API key of your account. |
| Page | query | number | false | The page number to display results for. If not specified, the first page is returned. |
| PageSize | query | number | false | The maximum number of results per page. This must be a positive integer up to 1000.Returns 50 results per page if not specified. If a value greater than 1000 is specified, it is treated as 1000. |
| From | query | date | false | The start date value to return results. Ā If not specified, results are returned from the date the campaign was sent.Ā From date has a DD-MM-YYYY format. |
| To | query | date | false | The end date value to return results. If not specified, results are returned up to the current date.Ā Ā To date has a DD-MM-YYYY format. |
Response
| Status | Description | Headers | Schema |
|---|---|---|---|
| 200 OK | The request is successful. | Content-Type/jsonAccept/json | N/A |
-
Code- the response code. This is0if successful. -
Error- the response error message. This isnullif successful. -
Context- an object that contains all theĀPagingandĀAnalyticsinformation for the campaign:-
Paging- an object that contains the following information:-
PageSize- the page size of the results. This is0if not defined. -
CurrentPage- the number of the result page. This is1if not defined. -
Totalresults- the number of results that are included in the response. -
TotalPageCount- the total number of pages in your account. -
SortExpression- the sort expression associated with the column or columns being sorted. -
SortIsAscending- this isfalseif the results are not displayed in ascending order based on the sort expression.
-
-
Analytics- a list of recipients containing the following information for each recipient:-
Context- the email address of the recipient. -
ContextName- the name of the recipient. -
TotalCount- the total number of statistics based on the activityTypemade by the recipient. This can be opens, link clicks, and so on. Deprecated -
UniqueCount- the total number of unique statistics based on the activityTypemade by the recipient. This can be opens, link clicks, and so on. Deprecated -
ContextDescription:-
Type is
Unsubscribed- this contains the date-time the recipient unsubscribed from the campaign. -
Type is
LinkClicked- the link URL clicked will be displayed as an extra as seen in the above code example. -
Type is
Bounced- the Bounced Type will be displayed as an extra. -
Type is
Complains- the Timestamp will be displayed as an extra.
-
-
-
Timestamp- for all parametersSent,opened,LinkClickedetc an extra field with the time of the action is added in the response.
-