API Documentation V2
ImportToListTasks collection allows scheduling (asynchronous) imports to subscriber lists. Subscribers are imported from an external source, e.g. file stored on FTP server.
Currently, only one-time, immediately executed imports are supported.
Executing a GET request on ImportToListTasks collection allows polling for scheduled import status (e.g. if it is still in progress or already finished).
Data part of request for scheduling a new import to subscribers list.
Data element children:
Source element children:
Target element children:
ImportSetup element children:
Supported import modes:
Column element children:
* Importing to a standard field (such as "Email" or "Firstname") requires Field element. If you wish to import to custom property, you may either use Field element and specify custom property name or Property element if you prefer working with custom property IDs. Both ways are supported. Property IDs can be found in ExpertSender web panel.
List of standard fields:
* Either Email, Phone or CustomSubscriberId must be specified if custom mapping is provided with the request.
** Please note that for importing new subscribers providing Email is required. If you want to update a particular subscriber or import existing subscriber to new list you should provide only one of Email, EmailMd5 or EmailSha256.
Method returns ID of scheduled import. ID can be used to get import status using GET method.
Response Data element:
Scheduling a new subscribers list import with default options
Request:
POST https://api.esv2.com/v2/Api/ImportToListTasks HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 379
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>test_api_key1</ApiKey>
<Data>
<Source>
<Url>ftp://ftp.expertsender.com/Lists/test.csv</Url>
</Source>
<Target>
<Name>API test import </Name>
<SubscriberList>80</SubscriberList>
</Target>
</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 12:40:14 GMT
Content-Length: 147
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>24</Data>
</ApiResponse>
Scheduling a new subscribers list import with full options
Request:
POST https://api.esv2.com/v2/Api/ImportToListTasks HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml;charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 1210
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>test_api_key1</ApiKey>
<Data>
<Source>
<Url>ftp://ftp.expertsender.com/Lists/test.csv</Url>
<Username>username</Username>
<Password>password</Password>
</Source>
<Target>
<Name>API test import </Name>
<SubscriberList>80</SubscriberList>
</Target>
<ImportSetup>
<Mode>AddAndUpdate</Mode>
<Delimiter>,</Delimiter>
<Quote>"</Quote>
<Escape>"</Escape>
<Comment>|</Comment>
<Encoding>UTF-8</Encoding>
<StartingLine>1</StartingLine>
<AllowImportingUnsubscribedEmail>false</AllowImportingUnsubscribedEmail>
<AllowImportingRemovedByUiEmail>true</AllowImportingRemovedByUiEmail>
<AllowImportingUnsubscribedSmsMms>false</AllowImportingUnsubscribedSmsMms>
<AllowImportingRemovedByUiSmsMms>true</AllowImportingRemovedByUiSmsMms>
<CheckAllListsForUnsubscribes>true</CheckAllListsForUnsubscribes>
<Mapping>
<Column>
<Number>0</Number>
<Field>Firstname</Field>
</Column>
<Column>
<Number>1</Number>
<Field>Lastname</Field>
</Column>
<Column>
<Number>2</Number>
<Field>Email</Field>
</Column>
<Column>
<Number>3</Number>
<Property>94</Property>
</Column>
<Column>
<Number>4</Number>
<Field>age</Field>
</Column>
<Column>
<Number>5</Number>
<Field>Phone</Field>
</Column>
<Column>
<Number>6</Number>
<Field>CustomSubscriberId</Field>
</Column>
</Mapping>
</ImportSetup>
</Data>
</ApiRequest>