API
Add contact
A contact can be added with the XML structure below. You can also add up to 100 contacts in a single call. The contact information must then be sent within the <contact> tag. So you can place several contact tags one below the other in the same call.
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.mailinglist | int | The ID of the mailing list the contact must be added to. | Required |
details.contact | string | If more than one contact must be added, you can put the contact information inside a contact tag and place several of them one below the other here (up to 100 contacts per call). | Optional |
details.emailaddress | string | The email address of the contact being added. | Required |
details.confirmed | boolean | Sets the confirmation status of the contact to confirmed or not (yes or y or true or 1) | Optional |
details.ipaddress | int | The IP address of the user at the time of subscribing. | Optional |
details.subscribedate | int | Enter the subscription date as a unix timestamp. | Optional |
details.lastopen | int | Enter the 'last opened newsletter' date as a unix timestamp. | Optional |
details.add_to_autoresponders | string | Whether autoresponders created for the mailing list in question must be sent to this contact. Use true or false. Default: true | Optional |
details.add_to_autoresponders.fieldid | int | The ID of the custom field to be added. | Required |
details.add_to_autoresponders.fieldid.value | string | The value to assign to the custom field. For a checkbox there can be several values. Note that if a value contains an & sign, CDATA and urlencoding() must be used. | Required |
tagid | int | The ID of the tag to be added. | Optional |
tagname | string | The name of the tag to be added. | Optional |
Successful response
| Field | Type | Description |
|---|---|---|
status | string | The value of the status field is returned as “SUCCESS” on a successful response. |
data | If the statistics are found, the object is returned. |
<xmlrequest>
<username>admin</username>
<usertoken>0123456789abcdef0123456789abcdef01234567</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>AddSubscriberToList</requestmethod>
<responsetype>xml</responsetype>
<details>
<mailinglist>99</mailinglist>
<contact>
<emailaddress>email@mailcamp.nl</emailaddress>
<confirmed>yes</confirmed>
<ipaddress>203.0.113.10</ipaddress>
<subscribedate>1483228800</subscribedate>
<lastopen>1483228800</lastopen>
<add_to_autoresponders>false</add_to_autoresponders>
<customfields>
<item>
<fieldid>99</fieldid>
<value>Jan Jansen</value>
</item>
<item>
<fieldid>99</fieldid>
<value><![CDATA[Eten %26 Drinken]]></value>
<value><![CDATA[Sport]]></value>
<value>Jan Jansen</value>
</item>
<item>
<fieldid>99</fieldid>
<value>31/01/1980</value>
</item>
</customfields>
<tags>
<tagid>99</tagid>
<tagid>99</tagid>
<tagname><![CDATA[Prospect]]></tagname>
<tagname><![CDATA[Lead]]></tagname>
</tags>
</contact>
</details>
</xmlrequest>