Mailings

List of properties of the Mailing resource

Property

Type

Description

id

string

Id of the mailing

name

string

Name of the mailing

text

string

Content in TEXT format

  • SMS: content of the SMS

  • EMAIL: text version

html

string

Content in HTML format

Note: Only for the EMAIL media

link

string

Link representing the content:

  • VOICE: link to a VXML, WAV or MP3 file

  • VOICEMAIL: link to a WAV or MP3 file

subject

string

Subject of the e-mailing

Note: Only for the EMAIL media

replyContact

string

Reply means of the e-mailing

Note: Only for the EMAIL media

media

array

Media used to send messages

Note: Only for the EMAIL media

sender

string

Name of the sender

  • SMS: value of the TPOA

  • EMAIL: name of the sender

nbMessages

integer

Number of messages contained in the mailings

date

string

Send date for the messages

stats

objects

Statistics on the status of messages

dateUpdated

string

Date mailing updated

dateCreated

string

Date mailing created

pingUrl

string

Notification url for a status change

stepId

integer

Id of the step if the mailing is in a context of a campaign, NULL otherwise

guid

string

Single global id of the mailing

status

string

Status of the mailing

  • created: mailing (status by default)

  • canceled: mailing canceled before its start date (so no message has been sent)

  • interrupted: mailing canceled after its start date (so a portion of the messages may have been sent)

  • ended: mailing ended (timeout of the media exceeded)

nbContacts

integer

Number of contacts

 

Listing mailings

List of available filters

Property

Description

id

Filter according to one or more mailing ids

name

Filter according to the name of the mailing

media

Filter according to the media of the mailing

stepId

Filter allowing you to retrieve the mailings of a step

 

Example 1: Retrieving a mailing from its id

GET /rest/mailings HTTP/1.1

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImYyMzE2…
Host: api.messengeo.net
Content-Type: application/x-www-form-urlencoded

id=4682

 

With Curl

curl

-X GET

-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...ccOqbVow8xOQyQ"

-d id=4682

https://api.messengeo.net/rest/mailings

 

Example 2: Retrieving the EMAIL mailing of a step

GET /rest/mailings HTTP/1.1

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImYyMzE2…
Host: api.messengeo.net
Content-Type: application/x-www-form-urlencoded

stepId=103&media=EMAIL

 

With Curl

curl

-X GET

-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...ccOqbVow8xOQyQ"

-d stepId=103

-d media=EMAIL

https://api.messengeo.net/rest/mailings

 

Return

This method sends back as return campaigns encapsulated in a structure that also contains:

{
	"size": 1,
	"total": 1,
	"list": [
   	{
       	"application": "API",
       	"date": "2014-06-09 10:52:00",
       	"dateCreated": "2014-06-09 10:52:00",
       	"dateUpdated": "2014-06-12 10:52:11",
       	"guid": "6d3a0010174cce8208eacfb953445b97",
       	"html": null,
       	"id": "9210",
       	"link": null,
       	"media": "sms",
       	"metadata": null,
       	"name": "6d3a0010174cce8208eacfb953445b97",
       	"nbContacts": "36",
       	"nbMessages": "36",
       	"pingUrl": null,
       	"replyContact": null,
       	"sender": "",
       	"stats": {
           	"clicked": 0,
           	"date": null,
           	"hb": 0,
           	"ko": 0,
           	"no": 0,
           	"ok": 0,
           	"on": 0,
           	"opened": 0,
           	"optout": 0,
           	"rep": 0,
           	"sb": 0,
           	"total": 0,
           	"wait": 0
       	},
       	"status": "ended",
       	"stepId": "618",
       	"subject": null,
       	"text": "Campaign No2 marketing"
   	}
	]
}
 

Retrieving statistics for a mailing

To obtain the statistics of a mailing, the stat property must b explicitly requested which triggers the calculation of the statistics for the mailing. By default, statistics are not returned for questions of performance.

GET /rest/mailings HTTP/1.1

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImYyMzE2…
Host: api.messengeo.net
Content-Type: application/x-www-form-urlencoded

id=4682,properties=stats

 

With Curl

curl

-X GET

-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...ccOqbVow8xOQyQ"

-d id=4682

-d properties=stats

https://api.messengeo.net/rest/mailings

 

Email/Voice/Voicemail Statistics

{
	size: 1,
	total: 1,
	list:
	[
		{
		id: "8374",
		name: "fa20c7a795658987a33b74cef8e9352f",
		stats:
			{
				total: 45554,
				wait: 0,
				on: 45554,
				ok: 0,
				ko: 0,
				no: 0,
				optout: 0,
				opened: 0,
				clicked: 0,
				hb: 0,
				sb: 0,
				rep: 0,
				date: null
			}
		}
	],
	httpStatusCode: 200
}
 

SMS statistics

{
	size: 1,
	total: 552,
	list:
	[
		{
		id: "8375",
		name: "e35b1176a681e93395bbf6701703570f",
		stats:
			{
				total: 4395,
				wait: 0,
				on: 0,
				ok: 3961,
				ko: 434,
				no: 0,
				optout: 0,
				rep: 0
			}
		}
	],
	httpStatusCode: 200
}