API
Newsletter statistics (multiple)
This example shows how you can retrieve the statistics of several campaigns.
Parameters
| Field | Type | Description | Required / Optional |
|---|---|---|---|
username | string | The username used to log in to MailCamp. | Required |
usertoken | string | The unique token assigned to the user named above. | Required |
requesttype | string | The name of the relevant API file. | Required |
requestmethod | string | The name of the function being called. | Required |
details | See the fields below. | Required | |
listids | int | The comma-separated IDs of the mailing lists whose send statistics you want to retrieve. 'all' is for statistics of all lists. | Required |
sortinfo | int | See the fields below. | Optional |
sortinfo.SortBy | string | The order in which the statistics in the array must be sorted (starttime, finishtime). | Optional |
sortinfo.Direction | string | Whether sorting must be from low to high or the other way around (asc or desc). | Optional |
countonly | string | Whether only the count must be returned. Default: false. | Optional |
start | int | Enter the number from which point the result must be returned. Default: 0 (first result). | Optional |
perpage | string | The number of statistics to return per result. Choose 'all' for all opens. Default: 10 | Optional |
newsletterid | int | The ID of the newsletter whose send statistics you want to retrieve. | Optional |
newsletterid.DateSentSearch | The ID of the mailing list the contact is on. | Required | |
newsletterid.DateSentSearch.filter | string | This must be 1 in order to filter | Optional |
newsletterid.DateSentSearch.type | string | This can be before, after, exact(ly), between, notbetween and not. | Optional |
newsletterid.DateSentSearch.StartDate | string | The unix timestamp of the start date to search on. | Optional |
newsletterid.DateSentSearch.EndDate | string | The unix timestamp of the end date to search on. You only specify this if between or notbetween was chosen as the type | Optional |
userid | int | The ID of the user whose send statistics you want to retrieve. You can only configure this with an admin API token | Optional |
type | string | Here you can choose between newsletter, splittest or all. Default: newsletter | Optional |
Successful response
| Field | Type | Description |
|---|---|---|
status | string | The value of the status field is returned as “SUCCESS” on a successful response. |
data | int | If the statistics are found, the object is returned. |
Error response
| Field | Type | Description |
|---|---|---|
status | string | The value of the status field will be “FAILED”. |
errormessage | string | A text message explaining why the request failed. |
<xmlrequest>
<username>admin</username>
<usertoken>0123456789abcdef0123456789abcdef01234567</usertoken>
<requesttype>stats</requesttype>
<requestmethod>GetNewsletterStats</requestmethod>
<responsetype>xml</responsetype>
<details>
<listids>99</listids>
<newsletterid>99</newsletterid>
<sortinfo>
<SortBy>finishdate</SortBy>
<Direction>desc</Direction>
</sortinfo>
<searchinfo>
<DateSentSearch>
<filter>1</filter>
<type>between</type>
<StartDate>1662917256</StartDate>
<EndDate>1726075656</EndDate>
</DateSentSearch>
</searchinfo>
<start>0</start>
<perpage>all</perpage>
<type>newsletter</type>
</details>
</xmlrequest>