Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
Expand
titleClick 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, ...)

 

Expand
titleClick 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)
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."
}

 

 Users

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

ListUserInfo


DescriptionThe method provides the list of SMTP+ users associated to the distribution list of caller.
HTTP MethodPOST
URLhttps://send.mailup.com/API/v2.0/users/listuserinfo 
Reference
Expand
titleClick here to learn more about request parameters
The request must contain the user's credentials and an optional username to query

 

ListUsersDTO
ParameterTypeDescription
UserSMTPUserDTOthe calling User
UsernameStringoptional User from which to read the profile, if omitted the method returns the whole list of users
Expand
titleClick here to learn more about response parameters

The response is given by a JSON or XML document that has the structure of a list of users informations ( List<UserInfoDTO>).

 

UserInfoDTO
ParameterTypeDescription
UsernameSMTPUserDTOthe username
IdConsolelongthe console ID
IdListlongthe list Id
IsEnabledbooltrue if the user is enabled
Priorityintthe priority
Notestringnote
CreationDatedatetimecreation date
UpdateDatedatetimelast update date
DomainListstringthe list of allowed domains
SenderListstringthe list of allowed sender
BlockUntildatetimethe date until the user is blocked
AdminBlockbooltrue if the user is blocked by the system administrator
JSON request (example)
{"User":{"Username":"sNNNN_NN","Secret":"..."},"Username":"sMMMM_MM"}
JSON response (example)

Example of a successful response:

{
"Status":"done",
"Code":"0",
"Message":"Ok",
"UserList":
[
{
"Username":"sMMMM_MM",
"IdConsole":123,
"IdList":1,
"IsEnabled":true,
"Priority":3,
"Note":"",
"CreationDate":"2015-03-31T12:12:04",
"UpdateDate":"2015-03-31T12:12:34",
"DomainList":"",
"SenderList":"",
"BlockUntil":"0001-01-01T00:00:00",
"AdminBlock":false
}
]
}

 

Example of error:

{
"Status":"error",
"Code":"112",
"Message":"User is deleted."
}

 

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.
  112User is deleted.