Get subscriber activity
Activities collection allows retrieving a list of subscriber activity entries of specified kind. For example, a list of all clicks can be retrieved. This collection is, by its nature, read only.
Request data format
Request URL parameters:
Supported activity data types:
URL examples:
https://api.esv2.com/v2/Api/Activities?apiKey=YOUR_API_KEY_HERE&date=2011-11-25&type=Clicks
https://api.esv2.com/v2/Api/Activities?apiKey=YOUR_API_KEY_HERE&date=2011-11-26&type=Subscriptions&channel=SmsMms
https://api.esv2.com/v2/Api/Activities/145408?apiKey=test_api_key1&date=2023-07-28&type=Opens&returnActivityIp=true
https://api.esv2.com/v2/Api/Activities/145408?apiKey=test_api_key1&date=2023-07-28&type=Opens&returnDeliveryIp=true
Response
This method differs from other methods by returning the data in CSV format, rather than XML. This is because the amount of data will usually be larger. CSV allows for reducing the overhead and is generally easier to parse and manipulate.
Response content type will be “text/csv”. Returned data will contain a header with column names. CSV will be formatted using following settings:
Field separator: comma (,)
Quoting character: (")
Escape character: (")
Encoding: UTF-8
Returned columns depend on requested activity type. See below for a complete listing of all columns for all available activity types.
Columns for Subscriptions activity:
* Returned only if channel option was set to All.
Columns for Confirmations activity:
* Returned only if returnActivityIp option was set to true.
** Returned only if returnDeliveryIp option was set to true.
Columns for Sends activity:
* Returned only if channel option was set to All.
** Extended columns.
*** Returned only if returnGuid option was set to true.
**** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
****** Returned only if returnDeliveryIp option was set to true.
Columns for Opens activity:
* Extended columns.
** Returned only if returnGuid option was set to true.
*** Returned only if returnMessageContentId option was set to true
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
****** Returned only if returnActivityIp option was set to true.
******* Returned only if returnDeliveryIp option was set to true.
Columns for Clicks activity:
* Returned only if channel option was set to All.
** Extended columns.
*** Returned only if returnGuid option was set to true.
**** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
****** Returned only if returnActivityIp option was set to true.
******* Returned only if returnDeliveryIp option was set to true.
Columns for Complaints activity:
* Extended columns.
** Returned only if returnGuid option was set to true.
*** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
Columns for Removals activity:
* Returned only if channel option was set to All.
** Extended columns.
*** Returned only if returnGuid option was set to true.
**** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
****** Returned only if returnActivityIp option was set to true.
******* Returned only if returnDeliveryIp option was set to true.
Columns for Bounces activity:
* Returned only if channel option was set to All.
** Extended columns.
*** Returned only if returnGuid option was set to true.
**** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
Columns for Goals activity:
* Returned only if channel option was set to All.
** Extended columns.
*** Returned only if returnGuid option was set to true.
**** Returned only if returnMessageContentId option was set to true.
***** Returned only if returnSegmentId option was set to true. If only a list was used then it will return 0.
****** Returned only if returnActivityIp option was set to true.
******* Returned only if returnDeliveryIp option was set to true.
Removal reasons:
Bounce reasons:
Examples
Request:
GET https://api.esv2.com/v2/Api/Activities?date=2010-10-01&apiKey=test_api_key1&type=Sends 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 463
Date,Email,MessageId,MessageSubject
2010-10-01 17:10:00,test1@yahoo.com,1168,some test subject
2010-10-01 17:10:00,test2@yahoo.com,1168,some test subject
2010-10-01 17:11:00,test3@yahoo.com,1168,some test subject
2010-10-01 17:11:00,test4@yahoo.com,1168,some test subject
2010-10-01 19:20:00,john.doe@gmail.com,1170,Hello dear subscriber
Request with extended columns:
GET https://api.esv2.com/v2/Api/Activities?date=2010-10-01&apiKey=test_api_key1&type=Sends&columns=Extended 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 523
Date,Email,MessageId,MessageSubject,ListId,ListName
2010-10-01 17:10:00,test1@yahoo.com,1168,some test subject,123,some list name
2010-10-01 17:10:00,test2@yahoo.com,1168,some test subject,123,some list name
2010-10-01 17:11:00,test3@yahoo.com,1168,some test subject,123,some list name
2010-10-01 17:11:00,test4@yahoo.com,1168,some test subject,123,some list name
2010-10-01 19:20:00,john.doe@gmail.com,1170,Hello dear subscriber,456,other list
Request with GUID:
GET https://api.esv2.com/v2/Api/Activities?date=2010-10-01&apiKey=test_api_key1&type=Sends&returnGuid=true 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 523
Date,Email,MessageId,MessageSubject,MessageGuid
2010-10-01 17:10:00,test1@yahoo.com,1168,some test subject,c7015756-95f3-4509-8c6c-759feec48f91
2010-10-01 17:10:00,test2@yahoo.com,1168,some test subject,f1184a56-86d5-461e-ac1b-0000040bb27b
2010-10-01 17:11:00,test3@yahoo.com,1168,some test subject,d56a7c29-885f-4fcc-8f85-00001392908b
2010-10-01 17:11:00,test4@yahoo.com,1168,some test subject,180668e3-7ea1-4f12-83b3-000004f11566
2010-10-01 19:20:00,john.doe@gmail.com,1170,Hello dear subscriber,a01b5b76-c61d-4533-bc3f-0000142e085d
Request with message content id and segment id:
GET https://api.esv2.com/v2/Api/Activities?date=2010-10-01&apiKey=test_api_key1&type=Opens&returnMessageContentId=true&returnSegmentId=true 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 523
Date,Email,MessageId,MessageSubject,CustomSubscriberId,MessageContentId,SegmentId
2010-10-01 17:10:00,test1@yahoo.com,1168,some test subject,c7015756-95f3-4509-8c6c-759feec48f91,,1222,34
2010-10-01 17:10:00,test2@yahoo.com,1168,some test subject,f1184a56-86d5-461e-ac1b-0000040bb27b,,1222,34
2010-10-01 17:11:00,test3@yahoo.com,1168,some test subject,d56a7c29-885f-4fcc-8f85-00001392908b,,1222,34
2010-10-01 17:11:00,test4@yahoo.com,1168,some test subject,180668e3-7ea1-4f12-83b3-000004f11566,,1222,34
2010-10-01 19:20:00,john.doe@gmail.com,1170,Hello dear subscriber,a01b5b76-c61d-4533-bc3f-0000142e085d,,1224,0
Request with Activity Ip :
GET https://api.esv2.com/v2/Api/Activities/145408?apiKey=test_api_key1&date=2023-07-28&type=Opens&returnActivityIp=true 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 523
Date,Email,MessageId,MessageSubject,CustomSubscriberId,ActivityIp
2023-07-28 09:30:00,test1@yahoo.com,147849,Test preference center :),,127.0.0.1
2023-07-28 09:30:00,test2@yahoo.com,147849,Test preference center :),,127.0.0.1
2023-07-28 09:30:00,test3@yahoo.com,147849,Test preference center :),,127.0.0.1
2023-07-28 09:30:00,test4@yahoo.com,147849,Test preference center :),,127.0.0.1
2023-07-28 09:30:00,test5@yahoo.com,147849,Test preference center :),,127.0.0.1
Request with Delivery Ip :
GET https://api.esv2.com/v2/Api/Activities/145408?apiKey=test_api_key1&date=2023-07-28&type=Opens&returnDeliveryIp=true 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/csv; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 2.0.50727
Set-Cookie: TIMEZONE=Central European Standard Time; path=/
X-Powered-By: ASP.NET
Date: Thu, 08 Dec 2011 12:02:14 GMT
Content-Length: 523
Date,Email,MessageId,MessageSubject,CustomSubscriberId,DeliveryIp
2023-07-28 09:30:00,test1@yahoo.com,147849,Test preference center :),,666.666.666.666
2023-07-28 09:30:00,test2@yahoo.com,147849,Test preference center :),,666.666.666.666
2023-07-28 09:30:00,test3@yahoo.com,147849,Test preference center :),,666.666.666.666
2023-07-28 09:30:00,test4@yahoo.com,147849,Test preference center :),,666.666.666.666
2023-07-28 09:30:00,test5@yahoo.com,147849,Test preference center :),,666.666.666.666