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

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.mailinglistint

The ID of the mailing list the contact must be added to.

Required
details.contactstring

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.emailaddressstring

The email address of the contact being added.

Required
details.confirmedboolean

Sets the confirmation status of the contact to confirmed or not (yes or y or true or 1)

Optional
details.ipaddressint

The IP address of the user at the time of subscribing.

Optional
details.subscribedateint

Enter the subscription date as a unix timestamp.

Optional
details.lastopenint

Enter the 'last opened newsletter' date as a unix timestamp.

Optional
details.add_to_autorespondersstring

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.fieldidint

The ID of the custom field to be added.

Required
details.add_to_autoresponders.fieldid.valuestring

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
tagidint

The ID of the tag to be added.

Optional
tagnamestring

The name of the tag to be added.

Optional

Successful response

Successful response
FieldTypeDescription
statusstring

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

data

If the statistics are found, the object is returned.

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