API
Get archive
This example shows how to retrieve the archive of sent newsletters, for instance to publish it on your website.
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 |
responsetype | string | The format of the response. This can be 'xml' or 'json'. | Optional |
details | See the fields below. | Required | |
details.listid | int | The ID of the mailing list whose newsletter archive you want to retrieve. | Required |
details.num_to_retrieve | int | The number of sent newsletters you want to retrieve. | Required |
Successful response
| Field | Type | Description |
|---|---|---|
status | string | The value of the status field is returned as “SUCCESS” on a successful response. |
name | int | The name of the sent newsletter. |
subject | string | The subject of the sent newsletter. |
starttime | int | The start time of the sending, in UNIX time format. |
listid | int | The ID of the mailing list. |
username | string | The username of the owner of the mailing list the newsletter was sent to. |
fullname | int | The full name of the owner of the mailing list the newsletter was sent to. |
textbody | int | The plain text content of the sent newsletter. |
status | string | The value of the status field is returned as “SUCCESS” on a successful response. |
htmlbody | int | The HTML content of the sent newsletter. |
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>lists</requesttype>
<requestmethod>GetArchives</requestmethod>
<responsetype>xml</responsetype>
<details>
<listid>99</listid>
<num_to_retrieve>99</num_to_retrieve>
</details>
</xmlrequest>