This example shows how you can schedule a newsletter for sending.

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

The type of action being scheduled. In this case a send (send).

Required
details.jobstatusstring

The status of the send. Possible values (w = waiting, p = paused, i = in progress, c = completed). In this case always use 'w'

Required
details.whenint

Unix timestamp of the moment of sending

Required
details.listsint

The ID of the mailing list to send to.

Required
responsetypestring

The format of the response. This can be 'xml' or 'json'.

Optional
details

See the fields below.

Required
details.NewsletterChosenint

The ID of the newsletter to be sent.

Required
details.Listsint

The ID of the mailing list to send to.

Required
SendCriteria

See the fields below.

Required
SendCriteria.Confirmedboolean

The confirmation status of the contacts being sent to; 'Confirmed' or 'unconfirmed', i.e. 1 or 0.

Required
SendCriteria.Statusstring

The status of the contacts being sent to. In this case only the active contacts (a), and not the unsubscribed or bounced contacts.

Required
SendCriteria.Listint

The ID of the mailing list to send to.

Required
SendCriteria.TagTypestring

How tags are filtered. Possible values: AND (match all tags), OR (match specific tags) and NONE (none of these tags)

Optional
SendCriteria.Tagsarray

This is the array of tag IDs of all the tags to filter on.

Optional
SendCriteria.SendSizeint

The number of contacts being sent to. You find this by first making an API call that calculates the number of subscribers that will be sent to.

Required
SendCriteria.BackStepboolean

Always leave this value at 1.

Required
SendCriteria.Multipartboolean

If the newsletter has both a text body and an HTML body, Multipart should be set to 1.

Required
SendCriteria.TrackOpensboolean

If the number of opened newsletters must be shown in the statistics, this value must be 1.

Required
SendCriteria.TrackLinksboolean

If the number of clicked links in newsletters must be shown in the statistics, this value must be 1.

Required
SendCriteria.EmbedImagesboolean

As a rule you do not want to send images as attachments in the newsletter. This value is therefore 0.

Required
SendCriteria.Newsletterint

The ID of the newsletter that will be sent.

Required
SendCriteria.SendFromNamestring

The name of the sender of this send.

Required
SendCriteria.SendFromEmailstring

The sender email address of this send.

Required
SendCriteria.ReplyToEmailstring

The reply-to email address of this send.

Required
SendCriteria.BounceEmailstring

The bounce email address of this send. This must be a unique address that is used only for reading out the bounced email.

Required
SendCriteria.To_FirstNameint

The ID of the Custom Field in which the First name of the contact is stored. This is usually 2.

Required
SendCriteria.To_Prefixint

The ID of the Custom Field in which the Prefix (infix) of the contact's surname is stored. This is usually 3.

Required
SendCriteria.To_LastNameint

The ID of the Custom Field in which the Last name of the contact is stored. This is usually 4.

Required
SendCriteria.Charsetstring

The character set is always UTF-8.

Required
SendCriteria.NotifyOwnerboolean

Send a message to the list owner about this send.

Required
SendCriteria.SendStartTimeint

Unix timestamp of the moment of sending.

Required
SendCriteria.SendStartTimeint

Unix timestamp of the moment of sending.

Required
SendCriteria.EmailResultsint

The elements success, failure and total must be set to 0. Any errors are logged here during sending.

Required
SendCriteria.module_tracker_google_options_namestring

If the newsletter results must be tracked in Google Analytics, the Campaign Name can be specified here.

Required
SendCriteria.module_tracker_google_options_sourcestring

If the newsletter results must be tracked in Google Analytics, the Campaign Source can be specified here.

Required
fkidint

The ID of the newsletter that will be sent.

Required
fktypestring

The type of the send is newsletter (newsletter).

Required
owneridint

The ID of the owner of the mailing list being sent to.

Required
approvedint

If the send must first be approved by an admin, you can set this to 0. Default is 1.

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>jobs</requesttype>
	<requestmethod>Create</requestmethod>
	<responsetype>xml</responsetype>
	<details>
		<jobtype>send</jobtype>
		<jobstatus>w</jobstatus>
		<when>1420596000</when>
		<lists>10</lists>
		<details>
			<NewsletterChosen>99</NewsletterChosen>
			<Lists>10</Lists>
			<SendCriteria>
				<Confirmed>1</Confirmed>
				<Status>a</Status>
				<List>10</List>
				<TagType>AND</TagType>
				<Tags>
					<array>9</array>
					<array>99</array>
					<array>999</array>
				</Tags>
			</SendCriteria>
			<SendSize>9999</SendSize>
			<BackStep>1</BackStep>
			<Multipart>1</Multipart>
			<TrackOpens>1</TrackOpens>
			<TrackLinks>1</TrackLinks>
			<EmbedImages>0</EmbedImages>
			<Newsletter>99</Newsletter>
			<SendFromName>MailCamp</SendFromName>
			<SendFromEmail>info@mailcamp.nl</SendFromEMail>
			<ReplyToEmail>reply@mailcamp.nl</ReplyToEmail>
			<BounceEmail>bounce@mailcamp.nl</BounceEmail>
			<To_FirstName>2</To_FirstName>
			<To_Prefix>3</To_Prefix>
			<To_LastName>4</To_LastName>
			<Charset>UTF-8</Charset>
			<NotifyOwner>1</NotifyOwner>
			<SendStartTime>1420596000</SendStartTime>
			<EmailResults>
				<success>0</success>
				<total>0</total>
				<failure>0</failure>
			</EmailResults>
			<module_tracker_google_options_name>Nieuwsbrief naam</module_tracker_google_options_name>
			<module_tracker_google_options_source>MailingList</module_tracker_google_options_source>
		</details>
		<fkid>99</fkid>
		<fktype>newsletter</fktype>
		<ownerid>99</ownerid>
		<approved>1</approved>
	</details>
</xmlrequest>