This example shows how to retrieve the archive of sent newsletters, for instance to publish it on your website.

Parameters

Parameters
FieldTypeDescriptionRequired / Optional
usernamestring

The username used to log in to MailCamp.

Required
usertokenstring

The unique token assigned to the user named above.

Required
requesttypestring

The name of the relevant API file.

Required
requestmethodstring

The name of the function being called.

Required
responsetypestring

The format of the response. This can be 'xml' or 'json'.

Optional
details

See the fields below.

Required
details.listidint

The ID of the mailing list whose newsletter archive you want to retrieve.

Required
details.num_to_retrieveint

The number of sent newsletters you want to retrieve.

Required

Successful response

Successful response
FieldTypeDescription
statusstring

The value of the status field is returned as “SUCCESS” on a successful response.

nameint

The name of the sent newsletter.

subjectstring

The subject of the sent newsletter.

starttimeint

The start time of the sending, in UNIX time format.

listidint

The ID of the mailing list.

usernamestring

The username of the owner of the mailing list the newsletter was sent to.

fullnameint

The full name of the owner of the mailing list the newsletter was sent to.

textbodyint

The plain text content of the sent newsletter.

statusstring

The value of the status field is returned as “SUCCESS” on a successful response.

htmlbodyint

The HTML content of the sent newsletter.

Error response

Error response
FieldTypeDescription
statusstring

The value of the status field will be “FAILED”.

errormessagestring

A text message explaining why the request failed.

Request example
<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>