This page provides you information about how to use MailUp REST API to create email messages and to send them to specified recipients.
On this page:
Email messages
An email message is always created inside the environment of a MailUp list, so it cannot be managed outside of that list.
Please note that, when creating a new email message, any referenced tag or attachment must be created in advance for that list.
Create a message
Please note that, when creating a new email message, any referenced tag or attachment must be created in advance for that list.
Description | Create a new email message |
---|---|
HTTP Method | POST |
URL | https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email |
JSON request (example) | |
JSON response (example) | {"Subject":"Monthly Newsletter 4","idList":2,"idMessage":47}
|
Paging and filtering (example) |
|
List Messages
Description | Retrieve email messages of specified list |
---|---|
HTTP Method | GET |
URL | Retrieve all email messages of that list GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Emails
Retrieve only email messages that have been published (i.e. with public visibility, see details) GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Online/Emails
Retrieve only email messages that have been archived (i.e. with public visibility, see details) GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Archived/Emails
*an empty list is returned if public visibility of messages (aka Web library) is disabled. You shall enable it to Retrieve them |
JSON request (example) | none |
JSON response (example) | All email messages of specified list
List published messages (public URLs are also provided)
List archived messages |
Paging and filtering (example) | 2 items per page, get first page (count starts from zero)
Retrieve messages that contain the word "test" in the subject field and order by ID. Note: search by text is case sensitive
|
Read message details
Description | Retrieve the email details (content, settings, attachment) by specified id |
---|---|
HTTP Method | GET |
URL | Retrieve the email details by specified id https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}
Get attachment list for the specified message id https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Attachment |
JSON request (example) | none |
JSON response (example) | Message content
Message attachments |
Paging and filtering (example) | 2 items per page, get first page (count starts from zero)
Retrieve messages that contain the word "test" in the subject field and order by ID. Note: search by text is case sensitive
|
Sending Queue Status
It is possible to retrieve the status of the sending queue for the outgoing messages by calling the following methods:
1) status of ongoing sendings: GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Sendings/Immediate
2) status of waiting sendings: GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Sendings/Deferred
3) status of sending to be planned: GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Sendings/Undefined
Moreover, it is possible to retrieve the first available date to send a specific sending:
where {id_sending} is the unique identifier of the sending to consider. The result is the date UTC date specified with the format described in the section 'Type and cast definition' of this page: "Paging and filtering".
Update message
This method allows you to modify an existing message (content and settings).
Please note that
- "Tags" field is mandatory, if you leave it empty the existing tags of that message are not modified. There is no way to clear all tags
- "Fields" parameter is optional
- "TrackingInfo > Protocols" field values are ignored if "TrackingInfo > Enabled" is set to false
Description | Modify an existing message |
---|---|
HTTP Method | PUT |
URL | https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message} |
JSON request (example) | Request data format is the same as the response of "GET /Console/List/{id_List}/Email/{id_Message}" |
JSON response (example) | {"Subject":"Monthly Newsletter!","idList":2,"idMessage":24} |
Paging and filtering (example) | none |
Manage tags
Description | Read available tags for a specified list |
---|---|
HTTP Method | GET, POST, PUT, DELETE |
URL | Retrieve list tags: GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Tags Create a new tag: POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Tag Modify a tag: PUT https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Tag/{id_Tag} Remove a list tag: DELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Tag/{id_Tag} |
JSON request (example) |
|
JSON response (example) | GET method returns the retrieved tags list POST and PUT methods return the full structure of the created/updated tag, e.g. {"Enabled":true,"Id":6,"Name":"my-new-tag"} An empty response is returned by DELETE method |
Paging and filtering (example) | none |
Manage email attachments
MailUp messages support a maximum of five attachments. Each attachment is placed in a specified "slot": adding and removing an attachment means adding to a message "slot" or removing from it.
Description | Read, add and remove message attachments |
---|---|
HTTP Method | GET, POST, DELETE |
URL | Retrieve all the attachments of a specified message GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Attachment
Add an attachment to message slot POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Attachment/{Slot}
Remove an attachment from a message slot DELETE https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Attachment/{Slot} |
JSON request (example) | Only POST method needs a request parameter. Attachment has to be Base64 encoded |
JSON response (example) | GET method returns a list of the documents that are attached to specified message. An empty array ([], not JSON format) is returned if no document is attached.
POST method returns the list of attachments after the command execution
DELETE method returns details about remaining attachments after deletion |
Paging and filtering (example) | none |
Send Email Messages
Email messages are usually sent with the sender name and the sender name that are specified as default settings for the MailUp list. As an alternative you can specify a different sender for a certain sending by specifying "SenderName" and "SenderAddress" (both, not only one of them) as querystring parameters.
Example: POST /Console/List/2/Email/30/Send?SenderName='John Smith'&SenderAddress='smith@example.com'
It is possible to specify an eventual date/time for a deferred sending, using the 'datetime' querystring parameter (UTC value), with the format described in the section 'Type and cast definition' of this page: "Paging and filtering"
Example: POST /Console/List/2/Email/30/Send?datetime='2014-10-20 05:00:00Z'
Message sending fails with HTTP 500 error if no authorized sender email nor sender email are provided. Ensure that sender name and sender email have been configured at list level (starting from MailUp version 8.6.1 the sender address has also to be a verified address)
Send to all subscribers
Description | Send a message to all list subscribers |
---|---|
HTTP Method | POST |
URL | Use the default list sender POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send Use the sender that is provided by querystring parameters POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?SenderName='{name}'&SenderAddress='{email}' |
JSON request (example) | none |
JSON response (example) | See notes at the bottom of this page1 {"InvalidRecipients":[],"Sent":7,"UnprocessedRecipients":[],"idMessage":24} |
Paging and filtering (example) | none |
Send to a group
Use the default list sender or a sender that is provided by querystring parameters (see example above)
Description | Send a message to all subscribers of specified group |
---|---|
HTTP Method | POST |
URL | POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Group/{id_Group}/Email/{id_Message}/Send |
JSON request (example) | none |
JSON response (example) | See notes at the bottom of this page1 {"InvalidRecipients":[],"Sent":3,"UnprocessedRecipients":[],"idMessage":30} |
Paging and filtering (example) | none |
Send to a recipient
Use the default list sender or a sender that is provided by querystring parameters (see example above)
Description | Send message to a single recipient |
---|---|
HTTP Method | POST |
URL | POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Send |
JSON request (example) | { "Email":"cheetah@jungle.net", "idMessage":24 } |
JSON response (example) | See notes at the bottom of this page1 {"InvalidRecipients":[],"Sent":3,"UnprocessedRecipients":[],"idMessage":30} |
Paging and filtering (example) | none |
Retrieve sending history
An email message can be sent several times. This feature allows to retrieve details about each sending.
Description | Retrieve information about sent history |
---|---|
HTTP Method | GET |
URL | GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/SendHistory |
JSON request (example) | none |
JSON response (example) | |
Paging and filtering (example) | N/A |
- "Sent" is the size of the sending queue and may include either previously enqueued recipients or, despite of its name, discarded recipients (invalid or unprocessed). "InvalidRecipients" is expected to be always empty when sending to all list subscribers or to a group. "UnprocessedRecipients" contains a list of recipients that are excluded from sending due to a restriction (e.g. in case of a trial console account or when the rate limiting described in API use policy is exceeded)