Get messages list
SMS or MMS messages collection contains a list of all sent messages. Multiple messages matching specified criteria can be retrieved. Specifying single message ID can be used to retrieve detailed information about a specific message.
Request data format
Get multiple messages
Request URL parameters:
Element/attribute | Type | Notes |
---|---|---|
apiKey | string | Your API key, required for authentication. Required. |
tag | string | Tag. Optional. If specified, only messages tagged with its value will be returned. |
startDate | date | Start date. Optional. If specified, messages sent before this date will not be returned. May be used together with endDate to specify a period of time. YYYY-MM-DD format. |
endDate | date | See startDate. |
type | string | Only return specific message types. Optional. Valid values: Newsletter WorkflowMessage |
Examples:
https://api.esv2.com/v2/Api/SmsMmsMessages?apiKey=YOUR_API_KEY_HERE
https://api.esv2.com/v2/Api/SmsMmsMessages?apiKey=YOUR_API_KEY_HERE&tag=sports
https://api.esv2.com/v2/Api/SmsMmsMessages?apiKey=YOUR_API_KEY_HERE&tag=sports&startDate=2016-05-20&endDate=2016-05-22
https://api.esv2.com/v2/Api/SmsMmsMessages?apiKey=YOUR_API_KEY_HERE&tag=sports&startDate=2016-05-20&endDate=2016-05-22&type=WorkflowMessage
Get message by Message ID
Request URL parameters:
Element/attribute | Type | Notes |
---|---|---|
apiKey | string | Your API key, required for authentication. Required. |
ID | int | SMS/MMS message ID. Required as a part of address (not GET parameter). See example below. |
Examples:
https://api.esv2.com/v2/Api/SmsMmsMessages/123?apiKey=YOUR_API_KEY_HERE
Response
Get multiple messages
Response Data element:
Element/attribute | Type | Notes |
---|---|---|
Messages | array[complex] | Array of Message elements. |
Message element children:
Element/attribute | Type | Notes |
---|---|---|
Id | int | Message identifier. |
Sender | string | Option selected in “Sender” field in SMS/MMS message wizard |
CampaignDescription | string | Value from “Campaign description” field in SMS/MMS message wizard |
Subject | string | Message subject. Only for MMS |
Type | string | Message type (Newsletter, WorkflowMessage etc). |
SentDate | datetime | Optional. Date when the message was sent. For messages that are sent many times (e.g. Autoresponders) it is the first date matching specified date range. |
Tags | string | Optional. List of comma-separated message tags. |
Get message by Message ID
Response Data element:
Element/attribute | Type | Notes |
---|---|---|
Id | int | Message identifier. Subject string Message subject. |
Sender | string | Option selected in “Sender” field in SMS/MMS message wizard |
CampaignDescription | string | Value from “Campaign description” field in SMS/MMS message wizard |
Subject | string | Message subject. Only for MMS. |
Type | string | Message type (Newsletter, WorkflowMessage etc). |
SentDate | datetime | Optional. Date when the message was sent. For messages that are sent many times (e.g. Autoresponders) it is the first date matching specified date range. |
Tags | string | Optional. List of comma-separated message tags. |
ThrottlingMethod | string | Optional. Throttling method. |
Throttling | int | Optional. Throttling period (hrs.). Filled only if ThrottlingMethod is “Manual”. |
GoogleAnalyticsTags | array[complex] | Optional. Array of GoogleAnalyticsTag elements (if message uses Google Analytics). |
Lists | array[complex] | Optional. Array of List elements (target subscriber lists). |
Segments | array[complex] | Optional. Array of Segment elements (target subscriber segments). |
ExcludedLists | array[complex] | Optional. Array of excluded List elements (target subscriber lists). |
ExcludedSegments | array[complex] | Optional. Array of excluded Segment elements (target subscriber segments). |
Status | string | Optional. Available only for newsletters. |
GoogleAnalyticsTag element children:
Element/attribute | Type | Notes |
---|---|---|
Name | string | Tag name, e.g. “utm_source”. |
Value | string | Tag value. |
List element children:
Element/attribute | Type | Notes |
---|---|---|
Id | int | List identifier. |
Name | string | List name. |
Segment element children:
Element/attribute | Type | Notes |
---|---|---|
Id | int | Segment identifier. |
Name | string | Segment name. |
ExcludedLists element children:
Element/attribute | Type | Notes |
Id | int | List identifier. |
Name | string | List name. |
ExcludedSegments element children:
Element/attribute | Type | Notes |
Id | int | Segment identifier. |
Name | string | Segment name. |
List of all possible ThrottlingMethod values:
ThrottlingMethod values | Notes |
---|---|
None | Message is not throttled |
Auto | Automatic throtling speed is applied. |
Manual | Throttling time was specified manually (see “Throttling” element) |
List of all possible Status values:
Status value |
---|
Scheduled |
InProgress |
Sent |
Paused |
Draft |
Deleted |
Examples
Get multiple messages
Request:
GET
https://api.esv2.com/v2/Api/SmsMmsMessages?startDate=2016-05-19&apiKey=test_api_key1 HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=cu23cqm125fq1qih1kg4ux45; path=/; HttpOnly
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 24 May 2010 12:56:22 GMT
Content-Length: 415
<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Data>
<Messages>
<Message>
<Id>892</Id>
<Type>Newsletter</Type>
<SentDate>2016-05-19T19:35:08</SentDate>
<Sender>John Smith</Sender>
<CampaignDescription>test newsletter</CampaignDescription>
</Message>
<Message>
<Id>893</Id>
<Type>Newsletter</Type>
<SentDate>2016-05-21T14:09:15</SentDate>
<Tags>test 1</Tags>
<Sender>SmsApiTest</Sender>
<CampaignDescription>test newsletter 2</CampaignDescription>
</Message>
</Messages>
</Data>
</ApiResponse>
Get message by Message ID
Request:
GET
https://api.esv2.com/v2/Api/SmsMmsMessages/893?apiKey=test_api_key1 HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=3e0htsjefgfcby55ra5b2045; path=/; HttpOnly
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 24 May 2010 12:59:37 GMT
Content-Length: 369
<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Data>
<Id>893</Id>
<Type>Newsletter</Type>
<SentDate>2016-05-21T14:09:15</SentDate>
<Sender>SmsApiTest</Sender>
<CampaignDescription>test newsletter 2</CampaignDescription>
<ExcludedLists>
<List>
<Id>3293</Id>
<Name>jp1</Name>
</List>
</ExcludedLists>
<ExcludedSegments>
<Segment>
<Id>3147</Id>
<Name>ludzie z telefonem - losowy 1000</Name>
</Segment>
</ExcludedSegments>
<Tags>test 1</Tags>
<ThrottlingMethod>Manual</ThrottlingMethod>
<Throttling>1</Throttling>
<Lists>
<List>
<Id>2</Id>
<Name>test list</Name>
</List>
</Lists>
<Status>Sent</Status>
</Data>
</ApiResponse>
Example response with Google Analytics tags:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=3e0htsjefgfcby55ra5b2045; path=/; HttpOnly
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 24 May 2010 12:59:37 GMT
Content-Length: 455
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<Id>123951</Id>
<Type>Newsletter</Type>
<Sender>SmsApiTest</Sender>
<CampaignDescription>Google Analytics tags test</CampaignDescription>
<ThrottlingMethod>Auto</ThrottlingMethod>
<GoogleAnalyticsTags>
<GoogleAnalyticsTag>
<Name>utm_source</Name>
<Value>testsource</Value>
</GoogleAnalyticsTag>
<GoogleAnalyticsTag>
<Name>utm_medium</Name>
<Value>Email</Value>
</GoogleAnalyticsTag>
<GoogleAnalyticsTag>
<Name>utm_content</Name>
<Value>testcontent</Value>
</GoogleAnalyticsTag>
<GoogleAnalyticsTag>
<Name>utm_campaign</Name>
<Value>testcampaign</Value>
</GoogleAnalyticsTag>
</GoogleAnalyticsTags>
<Status>Draft</Status>
</Data>
</ApiResponse>