API

Create mailing list

This example shows how you can create a mailing list through the API.

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

The name of the mailing list.

Required
details.owneremailstring

The sender address of the mailing list.

Required
details.ownernamestring

The sender name of the mailing list.

Required
details.bounceemailstring

The bounce address of the mailing list.

Required
details.replytoemailstring

The reply-to address of the mailing list.

Required
details.createdatestring

The creation date of the mailing list.

Required
details.listconfirmedtinyint

The confirmation status of a mailing list. 1 is confirmed. Default: 0.

Required
details.notifyownertinyint

Notify the owner when someone subscribes or unsubscribes. Default: 1.

Required
details.imapaccounttinyint

The bounce address is an IMAP account. Default: 1.

Required
details.bounceserverstring

The hostname of the bounce address.

Required
details.bounceusernamestring

The username of the bounce address.

Required
details.bouncepasswordstring

The password of the bounce address.

Required
details.extramailsettingsstring

Extra mail settings. Options: '/novalidate-cert', '/notls', '/nossl'. Default: '/notls'

Required
details.companynamestring

Company name. This information goes into the vCard that can be linked to in the newsletter.

Optional
details.companyaddressstring

Company address. This information goes into the vCard that can be linked to in the newsletter.

Optional
details.companyphonestring

Phone number. This information goes into the vCard that can be linked to in the newsletter.

Optional
details.owneridint

The user ID of the owner of the mailing list.

Required
details.subscribecountint

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

Optional
details.unsubscribecountint

The total number of unsubscribed contacts on the mailing list. Default: 0

Optional
details.agreedeleteboolean

The bounced addresses found in the mailbox are deleted after processing.

Required
details.agreedeleteallboolean

All addresses are deleted from the mailbox after processing.

Required
details.visiblefieldsstring

Comma-separated standard fields and IDs of custom fields that must be visible in the contacts overview.

Required
details.customfieldsstring

Comma-separated IDs of custom fields that must be linked to the mailing list.

Required

Successful response

Successful response
FieldTypeDescription
statusstring

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

dataint

If the statistics 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>lists</requesttype>
	<requestmethod>Create</requestmethod>
	<responsetype>xml</responsetype>
	<details>
		<name>Mailinglijst</name>
		<owneremail>info@mailcamp.nl</owneremail>
		<ownername>MailCamp B.V.</ownername>
		<bounceemail>bounce@mailcamp.nl</bounceemail>
		<replytoemail>antwoord@mailcamp.nl</replytoemail>
		<createdate>1483228800</createdate>
		<listconfirmed>1</listconfirmed>
		<notifyowner>1</notifyowner>
		<imapaccount>1</imapaccount>
		<bounceserver>mail.domein.nl:993</bounceserver>
		<bounceusername>bounce@mailcamp.nl</bounceusername>
		<bouncepassword>W@chtw00rd</bouncepassword>
		<extramailsettings>/novalidate-cert/ssl</extramailsettings>
		<companyname>MailCamp B.V.</companyname>
		<companyaddress>Amsterdamsevaart 26</companyaddress>
		<companyphone>020-7058500</companyphone>
		<ownerid>99</ownerid>
		<subscribecount>0</subscribecount>
		<unsubscribecount>0</unsubscribecount>
		<processbounce>1</processbounce>
		<agreedelete>1</agreedelete>
		<agreedeleteall>1</agreedeleteall>
		<visiblefields>emailaddress,subscribedate,updated,status,confirmed,2,4</visiblefields>
		<customfields>2,3,4,5</customfields>
	</details>
</xmlrequest>