Skip to content

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/attributeTypeNotes
apiKeystringYour API key, required for authentication. Required.
tagstringTag. Optional. If specified, only messages tagged with its value will be returned.
startDatedateStart 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.
endDatedateSee startDate.
typestringOnly 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/attributeTypeNotes
apiKeystringYour API key, required for authentication. Required.
IDintSMS/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/attributeTypeNotes
Messagesarray[complex]Array of Message elements.

Message element children:

Element/attributeTypeNotes
IdintMessage identifier.
SenderstringOption selected in “Sender” field in SMS/MMS message wizard
CampaignDescriptionstringValue from “Campaign description” field in SMS/MMS message wizard
SubjectstringMessage subject. Only for MMS
TypestringMessage type (Newsletter, WorkflowMessage etc).
SentDatedatetimeOptional. 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.
TagsstringOptional. List of comma-separated message tags.

Get message by Message ID

Response Data element:

Element/attributeTypeNotes
IdintMessage identifier. Subject string Message subject.
SenderstringOption selected in “Sender” field in SMS/MMS message wizard
CampaignDescriptionstringValue from “Campaign description” field in SMS/MMS message wizard 
SubjectstringMessage subject. Only for MMS.
TypestringMessage type (Newsletter, WorkflowMessage etc).
SentDatedatetimeOptional. 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.
TagsstringOptional. List of comma-separated message tags.
ThrottlingMethodstringOptional. Throttling method.
ThrottlingintOptional. Throttling period (hrs.). Filled only if ThrottlingMethod is “Manual”.
GoogleAnalyticsTagsarray[complex]Optional. Array of GoogleAnalyticsTag elements (if message uses Google Analytics).
Listsarray[complex]Optional. Array of List elements (target subscriber lists).
Segmentsarray[complex]Optional. Array of Segment elements (target subscriber segments).
StatusstringOptional. Available only for newsletters.

GoogleAnalyticsTag element children:

Element/attributeTypeNotes
NamestringTag name, e.g. “utm_source”.
ValuestringTag value.

List element children:

Element/attributeTypeNotes
IdintList identifier.
NamestringList name.

Segment element children:

Element/attributeTypeNotes
IdintSegment identifier.
NamestringSegment name.

List of all possible ThrottlingMethod values:

ThrottlingMethod valuesNotes
NoneMessage is not throttled
AutoAutomatic throtling speed is applied.
ManualThrottling 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>
     <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>
On this page
To top