API

Get mailing lists

This example displays an overview of all mailing lists created in MailCamp, in an XML with the data found.

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
listsint

Comma-separated list IDs of the lists you want to retrieve information about

Required
sortinfoint

See the fields below.

Optional
sortinfo.SortBystring

The order in which the lists in the array must be sorted (Name, CreateDate, subscribecount, unsubscribecount, fullname).

Optional
sortinfo.Directionstring

Whether sorting must be from low to high or the other way around (asc or desc).

Optional
countonlystring

Whether only the count must be returned. Default: false.

Optional
confirmedonlystring

Whether only the confirmed lists must be returned. Default: true.

Optional
startint

Enter the number from which point the result must be returned. Default: 0 (first result).

Required
perpageint

The number of lists to return per result. Choose 'all' for all lists. Default: 10

Required
statustinyint

Whether only the active lists must be returned. Default: 1.

Required

Successful response

Successful response
FieldTypeDescription
statusstring

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

status.listidint

The ID of the mailing list.

status.namestring

The name of the mailing list.

status.createdateint

The creation date (unix_timestamp) of the mailing list.

status.updatedint

The date of the last change (unix_timestamp) of the mailing list.

status.deletedint

If the list has been deleted, a date (unix_timestamp) of the moment of deletion.

status.statustinyint

Status of the mailing list

status.subscribecountint

The total number of active and confirmed contacts on the mailing list.

status.unsubscribecountint

The total number of unsubscribed contacts on the mailing list.

status.owneridint

The user ID of the owner of the mailing list.

status.ownernamestring

The name of the owner of the mailing list.

status.owneremailstring

The sender address of the mailing list.

status.bounceemailstring

The bounce address of the mailing list.

status.replytoemailstring

The reply-to address of the mailing list.

status.listconfirmedtinyint

Status of the mailing list (confirmed or unconfirmed)

status.spftinyint

Whether a valid SPF record was found

status.dkimtinyint

Whether a valid DKIM record was found

status.autonewsletteridint

The ID of the newsletter that must be sent after subscribing to a mailing list. Default: 0

status.usernamestring

The username of the owner of the mailing list

status.fullnamestring

The full name of the owner of the mailing list

status.smtpserverstring

The SMTP settings of the owner of the mailing list

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>GetLists</requestmethod>
	<responsetype>xml</responsetype>
	<details>
		<lists />
		<countonly>false</countonly>
		<confirmedonly>true</confirmedonly>
		<sortinfo>
			<SortBy>createdate</SortBy>
			<Direction>asc</Direction>
		</sortinfo>
		<start>0</start>
		<perpage>all</perpage>
	</details>
</xmlrequest>