API
Get contacts
This example returns an XML with the total number of contacts on a given mailing list, along with an overview of all contacts in that list.
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.List | int | The ID of the mailing list the contact is on. | Required |
details.List.Email | string | The email address of the contact you are trying to find | Optional |
details.List.Confirmed | boolean | The confirmation status of the contact you are trying to find (0 or 1) | Optional |
details.List.Status | boolean | The status of the contact; a (active), b (bounced) or u (unsubscribed) | Required |
details.List.DateSearch / DateUpdatedSearch | Filter on a specific date interval based on the subscription date. Enter the date as a unix timestamp in the StartDate field and optionally in the EndDate field. 5 different types: | Optional | |
details.List.DateSearch / DateUpdatedSearch.after | string | All contacts subscribed after the given date. | Optional |
details.List.DateSearch / DateUpdatedSearch.between | string | All contacts subscribed between 2 given dates. Specify the end date in the EndDate field. | Optional |
details.List.DateSearch / DateUpdatedSearch.before | string | All contacts subscribed before the given date. | Optional |
details.List.DateSearch / DateUpdatedSearch.exact/exactly | string | All contacts subscribed exactly on the given date. | Optional |
details.List.DateSearch / DateUpdatedSearch.not | string | All contacts who did not subscribe on the given date. | Optional |
details.List.Newsletter | int | The ID of a newsletter the contact must have opened. | Optional |
details.List.Tags | int | The ID of a tag of a contact. | Optional |
details.List.SortBy | string | The order in which the newsletters in the array must be sorted (subscribedate, emailaddress, format, status or confirmed). | Optional |
details.List.Direction | string | Whether sorting must be from low to high or the other way around (Down or Up). | Optional |
details.List.start | int | The first page to start searching from. | Optional |
details.List.perpage | string | Number of contacts per result. The default is 10. The value 'all' returns all records. | Optional |
Successful response
| Field | Type | Description |
|---|---|---|
status | string | The value of the status field is returned as “SUCCESS” on a successful response. |
count | int | The total number of contacts. |
subscriberlist | int | An overview of all email addresses of the contacts. |
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>subscribers</requesttype>
<requestmethod>GetSubscribers</requestmethod>
<responsetype>xml</responsetype>
<details>
<countonly>false</countonly>
<searchinfo>
<List>99</List>
<Email>@uwdomein.nl</Email>
<Confirmed>1</Confirmed>
<DateSearch>
<filter>true</filter>
<type>after</type>
<StartDate>1483228800</StartDate>
</DateSearch>
<DateUpdatedSearch>
<filter>true</filter>
<type>between</type>
<StartDate>1483228800</StartDate>
<EndDate>1559347200</EndDate>
</DateUpdatedSearch>
<Newsletter>99</Newsletter>
<Tags>99</Tags>
</searchinfo>
<sortdetails>
<SortBy>subscribedate</SortBy>
<Direction>asc</Direction>
</sortdetails>
<start>0</start>
<perpage>10</perpage>
</details>
</xmlrequest>