API Documentation V2
Newsletters collection allows creating and sending Web Push newsletter messages.
Data part of request for creating a new newsletter.
Data element children:
Recipients element children:
*Web Push Newsletter has to have at least one subscriber list or subscriber segment.
Content element children:
Action1 and Action2 element children:
GoogleAnalyticsTags element children:
Note: The remaining tag, "utm_medium" is by default specified as "WebPush".
UrlIntegrations element children:
Example:
<UrlIntegrations>
<UrlIntegration>
<Id>30</Id>
</UrlIntegration>
<UrlIntegration>
<Id>32</Id>
</UrlIntegration>
</UrlIntegrations>
BigImageFromBase64 and IconFromBase64 elements children:
*Note: Binary to Base64 encoding is available in most programing languages. For more information about Base64 encoding, see: http://en.wikipedia.org/wiki/Base64
DeliverySettings element children:
Delivery throttling methods:
Method returns ID of created newsletter.
Response Data element:
Sending a simple newsletter
Request:
POST https://api.esv2.com/v2/Api/WebPushNewsletters HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 457
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>test_api_key</ApiKey>
<Data>
<Recipients>
<SubscriberSegments>
<SubscriberSegment>1074</SubscriberSegment>
</SubscriberSegments>
</Recipients>
<Content>
<Subject>Hello!</Subject>
<Body>Hello friend, how are you?</Body>
<Link>https://www.google.com</Link>
</Content>
</Data>
</ApiRequest>
Response:
HTTP/1.1 201 Created
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 27 Mar 2012 13:28:01 GMT
Content-Length: 149
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>1498</Data>
</ApiResponse>
Sending a simple newsletter with action buttons, tags, Google Analytics Tags and images
POST https://api.esv2.com/v2/Api/WebPushNewsletters HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 457
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>test_api_key</ApiKey>
<Data>
<Recipients>
<SubscriberSegments>
<SubscriberSegment>1074</SubscriberSegment>
</SubscriberSegments>
</Recipients>
<Content>
<Subject>Hello!</Subject>
<Body>Hello friend, how are you?</Body>
<Link>https://www.google.com</Link>
<BigImageFromUrl>https://www.google.pl/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png</BigImageFromUrl>
<IconFromBase64>
<FileName>test.jpg</FileName>
<Content>JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu
ZyhwbC1QTCkgL1N0cnVjdFRyZWVSb290IDggMCBSL01hcmtJbmZvPDwvTWFya2VkIHRydWU+Pj4+
DQplbmRvYmoNCjIgMCBvYmoNCjw8L1R5cGUvUGFnZXMvQ291bnQgMS9LaWRzWyAzIDAgUl0gPj4N
CmVuZG9iag0KMyAwIG9iag0KPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9G
...
ODlFOENBQTNGMTY5NzFBRTU+XSAvUHJldiA4MjU0MS9YUmVmU3RtIDgyMjcwPj4NCnN0YXJ0eHJl
Zg0KODMwNTcNCiUlRU9G</Content>
</IconFromBase64>
<Tags>
<Tag>actions</Tag>
<Tag>buttons</Tag>
</Tags>
<GoogleAnalyticsTags>
<Campaign>testcampaign</Campaign>
<Source>testsource</Source>
<Content>testcontent</Content>
</GoogleAnalyticsTags>
<Action1>
<Title>ExpertSender</Title>
<Url>https://expertsender.com/</Url>
<IconFromBase64>
<FileName>test.jpg</FileName>
<Content>JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu
ZyhwbC1QTCkgL1N0cnVjdFRyZWVSb290IDggMCBSL01hcmtJbmZvPDwvTWFya2VkIHRydWU+Pj4+
DQplbmRvYmoNCjIgMCBvYmoNCjw8L1R5cGUvUGFnZXMvQ291bnQgMS9LaWRzWyAzIDAgUl0gPj4N
CmVuZG9iag0KMyAwIG9iag0KPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9G
...
ODlFOENBQTNGMTY5NzFBRTU+XSAvUHJldiA4MjU0MS9YUmVmU3RtIDgyMjcwPj4NCnN0YXJ0eHJl
Zg0KODMwNTcNCiUlRU9G</Content>
</IconFromBase64>
</Action1>
<Action2>
<Title>Request a demo</Title>
<Url>https://expertsender.com/company/free-demo-request/</Url>
</Action2>
</Content>
</Data>
</ApiRequest>