API

Get unsubscribes

This example shows how you can retrieve the unsubscribes of one or more statistics.

Parameters

Parameters
FieldTypeDescriptionRequired / Optional
statidsstring

Comma-separated IDs of statistics.

Required
listidint

If you want to retrieve the unsubscribes of a specific list. The statids parameter is ignored here.

Optional
order_bystring

The order in which the unsubscribes in the array must be sorted (emailaddress, unsubscribetime).

Optional
order_dirstring

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

Optional
count_onlystring

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

Optional
count_only.DateUnsubscribedSearch

The parameter for searching by date.

Required
count_only.DateUnsubscribedSearch.filterstring

This must be 1 in order to filter

Optional
count_only.DateUnsubscribedSearch.typestring

This can be before, after, exact(ly), between, notbetween and not.

Optional
count_only.DateUnsubscribedSearch.StartDatestring

The unix timestamp of the start date to search on.

Optional
count_only.DateUnsubscribedSearch.EndDatestring

The unix timestamp of the end date to search on. You only specify this if between or notbetween was chosen as the type

Optional
startint

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

Optional
perpagestring

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

Optional

Successful response

Successful response
FieldTypeDescription
statusstring

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

dataarray

If the unsubscribes are found, the object is returned.

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>stats</requesttype>
	<requestmethod>GetUnsubscribes</requestmethod>
	<responsetype>xml</responsetype>
	<details>
		<statids>99</statids>
		<order_by>unsubscribetime</order_by>
		<order_dir>desc</order_dir>
		<listid>99</listid>
		<count_only>false</count_only>
		<searchinfo>
			<DateUnsubscribedSearch>
				<filter>1</filter>
				<type>between</type>
				<StartDate>1662917256</StartDate>
				<EndDate>1726075656</EndDate>
			</DateUnsubscribedSearch>
		</searchinfo>
		<start>0</start>
		<perpage>10</perpage>
	</details>
</xmlrequest>