Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Messages

To access this resource and use the methods, you must have a SMTP+ user enabled. Usename and password must be included in each request.

SendMessage

DescriptionThe method allows the sending of a message to multiple recipients, the message content is passed as input in HTML or plain text. The message may also include attachments and embedded images.
HTTP MethodPOST
URLhttps://send.mailup.com/API/v2.0/messages/sendmessage
Reference
 Click here to learn more about request parameters

The method takes as input the document JSON or XML that has the structure MessageDTO defined in the tables below.

MessageDTO
ParameterTypeDescription
SubjectStringthe subject of the message
HtmlHtmlDTOthe HTML part of the message
TextStringthe plain text part of the message
FromEmailAddressDTOthe sender
ToList<EmailAddressDTO>the list of recipients in To header
CcList<EmailAddressDTO>the list of recipients in Cc header
BccList<EmailAddressDTO>the list of recipients in Bcc
ReplyToStringThe Reply-To header value
CharSetStringThe charset of the message body
ExtendedHeadersList<NameValueDTO>List of extended headers (only configured SMTP custom headers will be sent)
AttachmentsList<MessagePartDTO>List of attachments
EmbeddedImagesList<MessagePartDTO>list of embedded images
XSmtpAPIXSmtpAPIDTOthe X-SMTPAPI header value, used for custom aggregations and configurations
UserSmtpUserDTOthe SMTP+ user credentials

 

HtmlDTO
ParameterTypeDescription
DocTypeStringThe DOCTYPE directive
HeadStringThe head content
BodyStringThe body content
BodyTagStringthe body tag, default is "< body>"
EmailAddressDTO
ParameterTypeDescription
NameStringthe name
EmailStringthe email address
NameValueDTO
ParameterTypeDescription
NStringthe name of the parameter
VStringthe value of the parameter
MessagePartDTO
ParameterTypeDescription
FilenameStringthe file name
ContentIdStringthe Content-Id value
BodyArray of Bytethe array of byte of the content
XSmtpAPIDTO
ParameterTypeDescription
CampaignNameStringThe name used for the aggregated campaign
CampaignCodeStringThe campaign code which determines the aggregation
HeaderBooleanAdd or not the MailUp header to the message
FooterBooleanAdd or not the MailUp footer to the message
ClickTrackingBooleanUse the click tracking
ViewTrackingBooleanUse the view tracking
PriorityIntegerSet the priority of the message (1 high - 5 low )
ScheduleDateTimeSchedule date and time of the message
DynamicFieldsList<NameValueDTO>List of merge tags and dynamic field of the recipient
CampaignReportStringName of the aggregated campaign report
SkipDynamicFieldsBooleanskip merge tags evaluation
SmtpUserDTO
ParameterTypeDescription
UsernameStringthe username
SecretStringthe password

 

 

 Click here to learn more about response parameters


SendResponseDTO
ParameterTypeDescription
StatusStringthe status of the response can be "done" or "error"
CodeStringthe result code (see the Error Code table)
MessageStringthe result message

 


 JSON request (example)
 Click here to expand...
{
"Html":
{
"DocType":null,
"Head":null,
"Body":"<div>Hello Mr. [firstname] [lastname] !!!</div><br><img width=\\"600\\" height=\\"397\\" src=\\"cid:img001\\">",
"BodyTag":"<body>"
},
"Text":"Hello world!!!",
"Subject":"Hello friend!",
"From":{"Name":"Test User","Email":"test@mailup.it"},
"To":[{"Name":"Massimo","Email":"info@mailup.it"}],
"Cc":[],
"Bcc":[],
"ReplyTo":null,
"CharSet":"utf-8",
"ExtendedHeaders":null,
"Attachments":null,
"EmbeddedImages":
[
{
"Filename":"Image.jpg",
"ContentId":"img001",
"Body":"..."
}
],
"XSmtpAPI":
{
"CampaignName":"Test Campaign",
"CampaignCode":"1001",
"Header":null,
"Footer":null,
"ClickTracking":null,
"ViewTracking":null,
"Priority":null,
"Schedule":null,
"DynamicFields":[{"N":"firstname","V":"Mario"},{"N":"lastname","V":"Rossi"}],
"CampaignReport":null,
"SkipDynamicFields":null
},
"User":{"Username":"sNNNNN_NN","Secret":"..."}
}
JSON response (example)

Example of a successful response:

{
"Status":"done",
"Code":"0",
"Message":"Ok"
}

Example of error:

{
"Status":"error",
"Code":"102",
"Message":"The operation is not authorized."
}

 

SendTemplate

DescriptionThe method allows the sending of a message to multiple recipients, the message content HTML and plain text is obtained from a template stored in the MailUp administration console. The message may also include attachments and embedded images.
HTTP MethodPOST
URLhttps://send.mailup.com/API/v2.0/messages/sendtemplate 
Reference
 Click here to learn more about request parameters


TemplateDTO
ParameterTypeDescription
SubjectStringthe subject of the message
TemplateIdIntegerthe Id of the template
FromEmailAddressDTOthe sender
ToList<EmailAddressDTO>the list of recipients in To header
CcList<EmailAddressDTO>the list of recipients in Cc header
BccList<EmailAddressDTO>the list of recipients in Bcc
ReplyToStringThe Reply-To header value
CharSetStringThe charset of the message body
ExtendedHeadersList<NameValueDTO>List of extended headers (only configured SMTP custom headers will be sent)
AttachmentsList<MessagePartDTO>List of attachments
EmbeddedImagesList<MessagePartDTO>list of embedded images
XSmtpAPIXSmtpAPIDTOthe X-SMTPAPI header value, used for custom aggregations and configurations
UserSmtpUserDTOthe SMTP+ user credentials

 See the SendMessage reference for reading the definition of the others DTO (EmailAddressDTO, NameValueDTO, ...)

 

 Click here to learn more about response parameters


SendResponseDTO
ParameterTypeDescription
StatusStringthe status of the response can be "done" or "error"
CodeStringthe result code (see the Error Code table)
MessageStringthe result message

 

JSON request (example)
 Click here to expand...
{
"TemplateId":694,
"Subject":"Test message from template",
"From":{"Name":"Test User","Email":"test@mailup.it"},
"To":[{"Name":"Massimo","Email":"info@mailup.it"}],
"Cc":[],
"Bcc":[],
"ReplyTo":null,
"CharSet":"utf-8",
"ExtendedHeaders":null,
"Attachments":null,
"EmbeddedImages":null,
"XSmtpAPI":null,
"User":{"Username":"sNNNNN_NN","Secret":"..."}
}
JSON response (example)

Example of a successful response:

{
"Status":"done",
"Code":"0",
"Message":"Ok"
}

 

Example of error:

{
"Status":"error",
"Code":"111",
"Message":"The template is not found."
}

 

 

 

Error code

 

This table contains the list of error codes that can be returned by the API methods.

 

ErrorCode
Description
0Ok
1The operation is failed.
101The input is null.
102The operation is not authorized.
103The user is not enabled.
104The user is blocked.
105The user is blocked until this date.
106The console account is not found.
107The console account is suspended.
108The console account is deleted.
109At least one recipient is required.
110The sender is mandatory.
111The template is not found.
  

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

  • No labels