The following is a description of functions to enable communications delivery and other deliveries.
Batch deliveries
sendNewsletter
It enables a communication delivery according to the options MNSendOptions. Returns the ID of created delivery.
Parameter
Type
Description
idnewsletter
String
target
List of String
If MNSendOptions.trial = true the target parameter is the list of addresses to which you send a test message for a preview If MNSendOptions.trial = false the target parameter is the list of contacts audiences ids to which send the communication
BooleanenableEmail=true and Booleantrial=false to execute a final delivery.
Booleantrial: execute a trial delivery.
DateTimerequestedStartDate: you can specify a future date to start the delivery. If this value is empty or in the past, the delivery will start as soon as possible. Time and date have to be written according ISO8601 standard (Complete date plus hours, minutes and seconds): YYYY-MM-DDThh:mm:ssTZD (eg 2017-07-16T19:20:30+01:00)
BooleanenableSendTimeOptimization: the delivery will be sent with "Send Time Optimization" feature. This flag can't be enabled together with partitioned=true or usecontactstimezone=true.
IntegerspeedPerMinute: you can specify a limit to slow down the sending speed, indicating the number of emails per minute (0 means platform default).
advancedOptions
List of <Option>
Available options:
Booleanusenewsletteroptions: use default values from communication instead of what specified here.
Booleancssinline: automatically change the html in order to increase compatibility (default false).
Booleanwebbug: enable the web bug to allow the detection of HTML openings even if the user does not click (default true).
Stringemailbodyencoding: binary encoding of the body of the email (default windows-1252).
Stringemailsubjectencoding: binary encoding of the subject of the email (default windows-1252).
Booleanemailhtmlmultipart: send also a textual copy of the HTML emails with encoding "multipart/alternative" (default false).
Stringemailformat: force the emails delivery for a certain format: "HTML" = all html, "TEXT" = all text, "AUTO" = according to the contact's preferences. Default value is "HTML".
Booleanembed: incorporate all the resources (images, CSS) to allow the emails display even with disconnected email clients (default false)
Stringemailreplyto: "reply-to" address of emails (default email of the user who makes the call).
Booleanuseallchannels: use all available communication channels (in the case of multi-channel communication, e.g. SMS+email; default true).
Booleanusecontactsdata: use the contacts' data (valid only for deliveries with trial=true; default true).
Integeriddatabase: if usecontactsdata=true this is the database to use for contacts lookup.
Booleanignoreuserpreferencesonchannels: use the channels of communication without considering the contacts' preferences (default true).
Booleanconfirm: automatically confirm the launch without sending the launch confirmation email (default true).
Booleansendconfirmationrequest: when option confirm is set to "false", this flag determines whether the confirmation mail should be sent or not (default false).
Booleanenablesendreport: send a report as configured in journey settings (default false).
Booleanfailonemptytarget: for non-trial launches only, launch fails if at least one of the audiences specified in target is empty (default false).
Booleanpartitioned: used to create a partitioned launch (launch in multiple stages) using parameters: "partitions" and "partitionDelays" (default false).
Booleanrecall: used to send the communication only to contacts who received the mail in a previous delivery without opening or clicking it before and without recording an hard bounce. If it's a trial delivery this option won't be considered (default false).
Stringpartitions: list of integer separated by ';' char representing the percentage of each partition. For example: "10;20;70" means that first partition will be the 10% of target. Sum of partitions must be 100.
Stringpartitiondelays: list of integer separated by ';' char representing the deltas in milliseconds between partitions. For example: "0;86400000;172800000", means that first partition will be sent on the requestedStartDate, second partition the day after and third partition the day after that.
Booleanusecontactstimezone: if true a launch based on timezone will be created. The "requestedStartDate" of launch will be evaluated using the value of timezone field of each contact (default false).
Integeridpolicy: use this option to override the policy to use for this delivery. The sendNewsletter fails if this option is evaluated but the policy mapping feature is not active or if the "Choose a different policy for each delivery" journey option is false. See the getAllDeliveryPolicies for retrieve policies ids.
Booleanignoremissingunsubscribelink: used to disable the unsubscribe link presence checking. Whether "false" this function will fail if no unsubscribe link has been set in the communication (default true).
Booleanignoreencodingerrors: used to disable the charset compatibility checking. E.g. whether "false", this function will fail if you use "utf-8" characters not supported in "window-1252" encoding and the communication has the encoding set to "windows-1252" (default true).
Stringadditionaltargetfilterquery: query to optionally filter delivery target. For example: "SELECT * FROM CONTACTS WHERE status = 'subscribed'". This query will be applied to filter every audience of target
Integeremailpriority: set messages delivery priority. Available values: "1" - Highest, "2" - High, "3" - Normal (default, used when not declared), "4" - Low, "5" - Lowest
Stringchannels: comma separated list of custom channel identifiers for which to enable the delivery. This channels are added to the enabled channels specified in the options parameter. The custom channels in this list must be defined in the account.
Booleanforceusedeliverabilitycluster: if true, the sending policy will be the one in the contact delivery cluster, for contacts that have it valued (default false).
Booleanusedatabasepolicysettings: corresponds to the parameter that indicates, when configuring communication sending, whether to use the database delivery policy. If not specified, the journey delivery policy is used.
Return values: String
Permissions:Send communication for the journey and send communications and send communication to contacts of the database for each audience
getDeliveryStatus
Returns the delivery status. The delivery has completed the first launch to all contacts when it passes to status MNDeliveryStatus.status = "FINISHING" or "FINISHED". Delivery is active in the system if MNDeliveryStatus.active=true.
Permissions:Send communication for the journey and send communications
requestDeliveryStatusAction
Requires the modification of a delivery status. Notes: a delivery change of status might not be immediate. If some messages have been queued for delivery they may still be sent, besides the delivery stop request. The system automatically removes deliveries that are in "pause" for too long.
Parameter
Type
Description
idDeliveryStatus
String
action
String
values of actions: stop: requires to stop delivery pause: requires to temporarily suspend delivery resume: requires to resume delivery
Permissions:Send communication for the journey and send communications
queryDeliveryStatus
Returns a status page for deliveries of a given journey. The result is a RowSet to be downloaded using fetchDeliveryStatus
Parameter
Type
Description
idCampaign
String
Return values: String
Permissions:
queryDeliveries
Returns a status page for deliveries. The result is a RowSet to be downloaded using fetchDeliveryStatus
Parameter
Type
option
List of <Option>
Available options:
IntidCampaign: return only deliveries of communications of the given journey
IntidNewsletter: return only deliveries of communications of the given communication
Stringchannel: filter delivery channels, this is a list of strings delimited with comma, valid values are 'email','sms' and 'fax', Default = email,sms,fax
StringstartDateFrom: return only deliveries which have startDate >= the given timestamp. For the format see formatting date-times.
StringstartDateTo: return only deliveries which have startDate < the given timestamp. For the format see formatting date-times.
trials
trials
Boolean
If true (or not specified), they will be returned the test deliveries too. If false, the test deliveries will be discarded
Intidcontact: looks up for contact's profile data using the internal id of the contact
Intiddatabase: if the contact is not recognized this values is used to render the email as it was sent to a contact of a database
Stringcontactprimarykey: looks up for contact's profile data searching for a contact with the given primary key, in the given database (see iddatabase option)
Booleancontactprimarykeyoptional: If the contact isn't found, use the to field in the message values as recipient address instead of failing the delivery. Note: when no contact is found, no statistics are recorded, since the message is sent but there's no contact on any database to associate the message against.
Booleanusecontactemail: uses the email of the given contact as the recipient address of the message (overriding message.to). Default = false
Booleancssinline: apply css inline to the html content of the message. Default = false
Booleanembbeddedimages: download and embed all the images founded in the html content of the message (attaching them at the message). Default = false
Intidwebsite: specifies the website to use when rendering absolute URLs (for example image urls or [link:ununsubscribe] urls..). Default = id of the default website
Booleanusenewsletterastemplate: indicates to use a communication template (or notification message template, which is a special type of communication) as the message body. Default = false
Booleanrenderatsend: indicates to render the message during the delivery and not while serving the API call. This option must be used in conjunction with usenewsletterastemplate. This option will result in faster API calls and in less resources usage. This is the preferred way of sending messages using usenewsletterastemplate option. Default = false. With 'renderAtSend' option, message body will never be persisted on db, even if 'messageRetention' level is set to 'full'
Booleanusehtmlcodeastemplate: indicates to use html code as the message body. In this case for example you can use mn:if conditions and EmailMessage.tempvars. Default = false
Intidnewsletter: the communication whose template is used to draw the message (usenewsletterastemplate must be set to true).
Stringnewsletterkey: the key for sending by API of the communication whose template is used to draw the message (usenewsletterastemplate must be set to true). If idnewsletter and newsletterkey are both valued, idnewsletter will be used.
Stringformat: the format of the email (default is 'html', admitted values are 'html', 'text' and 'multipart').
TimestampexpectedDeliveryTs: requests to send the message at a given time. If empty it means 'as soon as possible'. This field must be formatted according to the formatting options of the user who runs the request. The timestap is always the user timestamp.
StringmessageRetention: Specify a retention policy for the given message between "minimal" (discard the message body), "full" (keep the whole message and headers) and "reserved" (discard the recipient).
Stringidlanguage: language of the notification message if the contact is not subscribed in any database
Booleannospool: indicates to attempt to avoid message spooling and send messages directly. This option can be helpful to send a message in a timely manner. Default = false
Intidcontact: looks up for contact's profile data using the internal id of the contact
Intiddatabase: if the contact is not recognized this values is used to render the email as it was sent to a contact of a database
Stringcontactprimarykey: looks up for contact's profile data searching for a contact with the given primary key, in the given database (see iddatabase option)
Booleancontactprimarykeyoptional: If the contact isn't found, use the to field in the message values as recipient address instead of failing the delivery. Note: when no contact is found, no statistics are recorded, since the message is sent but there's no contact on any database to associate the message against.
Booleanusecontactcell: uses the phone number (field 'cell') of the given contact as the recipient address of the message (overriding message.to). Default = false
Booleanusenewsletterastemplate: indicates to use a communication template (or notification message template, which is a special type of communication) as the message body. Default = false
Intidnewsletter: the communication whose template is used to draw the message (usenewsletterastemplate must be set to true)
Stringnewsletterkey: the key for sending by API of the communication whose template is used to draw the message (usenewsletterastemplate must be set to true). If idnewsletter and newsletterkey are both valued, idnewsletter will be used.
Intidwebsite: specifies the website to use when rendering absolute URLs (for example [link:ununsubscribe] urls..). Default = id of the default website
Booleanvalidatesmslength: If true the number of sms parts will be validated according to the maxsmsparts option together with the account settings. Default = true
TimestampexpectedDeliveryTs: requests to send the message at a given time. If empty it means 'as soon as possible'
Intmaxsmsparts: specifies the maximum number of parts of sms message. Messages splitted in a number of parts exceeding this limit will not be sent. Default = system maximum number of sms parts
StringmessageRetention: Specify a retention policy for the given message between "minimal" (discard the message body), "full" (keep the whole message and headers) and "reserved" (discard the recipient)
Booleannospool: indicates to attempt to avoid message spooling and send messages directly. This option can be helpful to send a message in a timely manner. Default = false
Stringsmsencoding: encoding of the SMS body (gsm, unicode)
Permissions: If referred to a database contact, database data export permissions for the specific database. If not referred to a database contact, database data export permissions for all the databases. Always the Send communication permissions.
batchGetSimpleMessageStatus
Returns the delivery status for notification messages.
Permissions: If referred to a database contact, database data export permissions for the specific database. If not referred to a database contact, database data export permissions for all the databases. Always the Send communication permissions.
batchCancelSimpleMessages
Stops the delivery of a batch of notification messages.
Note even if this function allows a more efficient execution of the operation (by reusing data structures and connections on the server side), it is not recommended to request batches of more than 1000 items (please, contact the technical support for any further information or suggestion).
Notes even if this function allows a more efficient execution of the operation (by reusing data structures and connections on the server side), it is not recommended to request batches of more than 1000 items (please, contact the technical support for any further information or suggestion).
Describes all available bounce categories. Notes: the list of bounce categories is updated not very frequently (once a month), you should cache this list
Describes all available policies for this account. Notes: if the policy mapping feature is not active in this account, it will be returned an empty list
Returns the residual credit for the given channel.
For the account with 'flat' plan: it returns residual credit plus automatic credit
For the account with 'final balance' plan: it returns always -1
Parameter
Type
Description
channel
String
Possible values: email, sms
option
List of <Option>
Return values: Number. It returns a value approximated to the nearest thousand rounding down if credit is 1000; it returns 0 if credit is 0 or negative.
Permissions: None (public data)
batchGetSimpleMessageStatusByExternalId
Returns the status of N transactional messages by their external ID
Permissions: If referred to a database contact, database data export permissions for the specific database. If not referred to a database contact, database data export permissions for all the databases.