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"

...

Querystring parameterDescriptionExample
SenderName
SenderAddress
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" parameters.
You have to provide
both parameters, and not only one of them.
POST .../Send?SenderName='John Smith'&SenderAddress='smith@example.com'
datetime

It is possible to specify an eventual UTC date/time for a deferred sending.
When a message sending is scheduled you cannot modify it.
The format described in the section 'Type and cast definition' of this page: "Paging and filtering".

POST .../Send?datetime="2014-10-20 05:00:00Z"
It is possible to specify the value undefined for datetime querystring parameter.
It means the message sending is scheduled as inactive. This option allows you to create a relationship between the messageand the recipients, as a snapshot: you can modify the message and when the message is ready you can decide to schedule the newsletter or to send it immediately.
POST .../Send?datetime="undefined"

It is possible to omit the datetime querystring parameter (default) or set its value to now.
It means the message is enqueued and it will be sent when the dequeue process reaches it.

Note
titleImportant tip!

As you can immagine, if you use this option to send to some recipients and you use the method to send to a single recipient now, you append a lot of items to your sending queue. Every time an item is processed, it starts a verification process that requires some seconds: if you enqueue 10.000 items your sending period could be very long. So, if you need to send to a single recipient we suggest to use our Transactional Emails APIs; otherwise, please use list or groups to enqueue multi-recipients items to the sending queue.

POST .../Send

POST .../Send?datetime="now"

replytoIt is possible to specify an email address for reply.POST .../Send?replyto="replyto@yourdomain.it"
Note

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)

...

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
{"InvalidRecipients":[],"Sent":7,"UnprocessedRecipients":[],"idMessage":24}

Paging and filtering (example)

none

...