Versions Compared

Key

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

This page provides you information about how to use MailUp REST API to create email messages and to send them to specified recipients.

...

DescriptionRetrieve email messages of specified list

HTTP Method

GET

URL

Retrieve all email messages of that list

Code Block
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) 1

Code Block
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 (see details) 1

Code Block
GET https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Archived/Emails

 

Note:

1 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

Expand
Code Block
{
	"IsPaginated":false,
	"Items":[
		{
			"CreationDate": "2017-05-29 08:21:59Z",
      		"Notes": "Issue n. 5",
      		"Subject": "Monthly Newsletter 4",
      		"idList": 1,
	        "idMessage": 38,
	        "ServiceType": 0
		},
		{
     	 	"CreationDate": "2017-05-24 13:05:08Z",
      		"Notes": "notes",
      		"Subject": "La prova",
      		"idList": 1,
      		"idMessage": 37,
      		"ServiceType": 0
    	}
	],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":2
}
Expand
titleAbout ServiceType field...

ServiceType field shows the message types. Here the most common values:

ValueDescription
0Newsletter
1SMTP+

P.S.: the ServiceType field has a value greater than 1 when your platform has a custom configuration. Please contact us, if you need more information.

 

List published messages (public URLs are also provided)

Expand

"LastSendDate":"0001-01-01 00:00:00Z" is returned when message has never been sent

Code Block
{
	"IsPaginated":false,
	"Items":[
		{
			"Subject":"Monthly Newsletter 4",
			"idList":2,
			"idMessage":62,
			"CreationDate":"2014-05-21 12:14:41Z",
			"LastSendDate":"0001-01-01 00:00:00Z",
			"Notes":"Issue n. 5",
			"Url":"http:\/\/d0i4e.s57.it\/frontend\/nl_preview_window.aspx?idNL=62"
		}
	],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":1
}

 

List archived messages

Expand
Code Block
{
	"IsPaginated":false,
	"Items":[
		{
			"Subject":"Annual Newsletter n.13",
			"idList":2,
			"idMessage":27,
			"CreationDate":"2014-05-22 09:37:56Z",
			"LastSendDate":"",
			"Notes":"Issue n. 10 June 2014",
			"Url":"http:\/\/d0i4f.s57.it\/frontend\/nl_preview_window.aspx?idNL=27"
		},
		{
			"Subject":"Annual Newsletter n.4",
			"idList":2,
			"idMessage":26,
			"CreationDate":"2014-05-22 08:55:15Z",
			"LastSendDate":"",
			"Notes":"Issue n. 6 June 2014",
			"Url":"http:\/\/d0i4f.s57.it\/frontend\/nl_preview_window.aspx?idNL=26"
		}
	],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":2
}

Paging and filtering (example)

2 items per page, get first page (count starts from zero):

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?PageNumber=0&PageSize=2

Retrieve messages that contain the word "test" in the subject field and order by ID. Note: search by text is case sensitive:

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?filterby="Subject.Contains(%27test%27)"&orderby="idMessage+asc"

Retrieve only the messages with tags whose IDs are 1, 13 or 45 (at least one of them):

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?tags="1,13,45"

Retrieve only the messages with tags whose ID is 13 or names are customers, welcome message or hello, world (at least one of them):

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?tags="13,customers,welcome message,'hello, world'"

Retrieve only the newsletter messages:

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?filterby="servicetype==0"

Retrieve only the SMTP+ messages:

  • https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/2/Emails?filterby="servicetype==1"

...

DescriptionSend a message to all list subscribers

HTTP Method

POST

URL

 Use the default list sender

Code Block
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

Code Block
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

Code Block
{"Id":2147483647,"InvalidRecipients":[],"Sent":7,"UnprocessedRecipients":[],"idMessage":24}

Paging and filtering (example)

none

...

Description

Send a message to list subscribers filtering by groups. The method allows subscribers inclusion and exclusion by groups.
The method applies this logic:

  • include subscribers by groups defined by inGroups querystring parameters;
  • exclude subscribers by groups defined by notInGroups querystring parameters.

The method checks if the selected list contains the provided groups.

HTTP Method

POST

URL

Inclusion

Include subscribers by one or more groups.
It is mandatory that the list contains at least one of provided groups, otherwise the method return a 500 error.
If a subscriber appairs in more then one group, it will be taken only one time.

Code Block
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?inGroups=12
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?inGroups=12,23,45


Exclusion

Exclude subscribers by one or more groups.
If the list does not contain all provided groups, the method does not exclude any subscribers and it sends the newsletter to all list subscribers.

Code Block
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?notInGroups=12
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?notInGroups=12,23,45

 

Inclusion and exclusion

Include and exclude subscribers by one or more groups.
It is mandatory that the list contains at least one of groups defined by inGroups querystring parameter, otherwise the method return a 500 error.
The method exclude subscribers by groups if list contains at least one group from notInGroups querystring parameter, otherwise the method does not exclude any subscribers and sends the newsletter to all subscribers contained in groups defined by inGroups querystring parameter.

Code Block
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?inGroups=12&notInGroups=89,90
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/List/{id_List}/Email/{id_Message}/Send?inGroups=12,23,45&notInGroups=89

JSON request (example)

none

JSON response (example)

See notes at the bottom of this page1

Code Block
{"Id":2147483647,"InvalidRecipients":[],"Sent":7,"UnprocessedRecipients":[],"idMessage":24}

Paging and filtering (example)

none


...

DescriptionSend a message to all subscribers of specified group

HTTP Method

POST

URL

Code Block
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

Code Block
{"Id":2147483647,"InvalidRecipients":[],"Sent":3,"UnprocessedRecipients":[],"idMessage":30}

Paging and filtering (example)

none

...

DescriptionSend message to a single recipient

HTTP Method

POST

URL

Code Block
POST https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc/Console/Email/Send

JSON request (example)

Code Block
{
	"Email":"cheetah@jungle.net",
	"idMessage":30
}

JSON response (example)

See notes at the bottom of this page1

Code Block
{"Id":2147483647,"InvalidRecipients":[],"Sent":3,"UnprocessedRecipients":[],"idMessage":30}

Paging and filtering (example)

none

...

DescriptionRetrieve information about sent history

HTTP Method

GET

URL

Code Block
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)

Expand

An email message has been sent three times with different senders, here below the results

Code Block
{
	"IsPaginated":false,
	"Items":[
		{
			"Id": 26,
			"EndDate":"2014-04-01 13:53:06Z",
			"Kb_transferred":6302,
			"Recipients":1,
			"SenderEmail":"marketing@example.com",
			"SenderName":"Your Dealer",
			"StartDate":"2014-04-01 13:52:35Z",
			"idMessage":12
		},
		{
			"Id": 27,
			"EndDate":"2014-04-01 13:54:32Z",
			"Kb_transferred":12604,
			"Recipients":2,
			"SenderEmail":"brown@example.com",
			"SenderName":"Mike Brown",
			"StartDate":"2014-04-01 13:53:57Z",
			"idMessage":12
		},
		{
			"Id": 28,
			"EndDate":"2014-04-06 13:48:33Z",
			"Kb_transferred":12604,
			"Recipients":2,
			"SenderEmail":"sales@example.com",
			"SenderName":"Sales",
			"StartDate":"2014-04-06 13:48:04Z",
			"idMessage":12
		}],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":3
}

Paging and filtering (example)

N/A

 

  1. "Id" is the sending identifier. "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).

when creating a new email message, any referenced tag or attachment must be created in advance for that list.