Skip to content

Import to Suppression Lists

ImportToSuppressionListTasks collection allows scheduling (asynchronous) imports to suppression 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 ImportToSuppressionListTasks collection allows polling for scheduled import status (e.g. if it is still in progress or already finished).

Request data format

Data part of request for scheduling a new import to suppression list.

Data element children:

Element/attributeTypeNotes
SourcecomplexImported file information. Required.
TargetcomplexTarget suppression list data. Required.
ImportSetupcomplexImport settings, file settings, column mapping etc. Optional. If omitted, default settings will be used.

Source element children: 

Element/attributeTypeNotes
Urlstring
URL address of imported file. Supported protocols are HTTP, HTTPS, FTP, FTPS and SFTP. E.g. ftp://www.domain.com/myimportedfile.csv
UsernamestringUsername used for authentication. Optional.
Passwordstring
Password used for authentication. Optional.
FtpAuthstringAuthentication method for secure FTP servers. Optional. Valid values are:None – FTP server does not support secure authentication (default)
ExplicitTls – Explicit TLS/SSL authentication
ExplicitSsl – Explicit SSL only authentication
ImplicitSsl – Implicit SSL authentication
FtpUseActiveModestringIf set to “true”, active mode will be used for FTP connections. Default value is “false” – passive connection mode will be used.

Target element children: 

Element/attributeTypeNotes
NamestringImport name. Used internally for easier identification. Required.
SuppressionListintegerID of suppression list that records will be imported to. Required.

ImportSetup element children: 

Element/attributeTypeNotes
ModestringImport mode. Optional. Defaults to “Add”.
EntryTypestringType of entries to be added. It matters only when importing to an SMS type list. The available options are “Phone” and “DialingPrefix”. Optional. Defaults to “Phone”.
DelimiterstringCSV file delimiter. Optional. Default value is ‘,’ (comma).
QuotestringCSV file quoting character. Optional. Default value is ‘”‘ (double quote).
EscapestringCSV file escape character. Optional. Default value is ‘”‘ (double quote).
CommentstringCSV file comment character. Optional. Default value is zero-byte (undefined).
EncodingstringCSV file encoding. Optional. Default is “utf-8”
ColumnNumberstringThe column number in the file we will import. Optional. Default is 0 – that is, the first column.

Supported import modes: 

ModeBehaviour
AddAdd new records to the suppression list.
SynchronizeWhole suppression list will be replaced with imported file content.

Response

Method returns ID of scheduled import. ID can be used to get import status using GET method.

Response Data element:

Element/attributeTypeNotes
(Data element content)intID of scheduled import.

Examples

Scheduling a new subscribers suppression list import with default options 

Request: 

POST https://api.esv2.com/v2/Api/ImportToSuppressionListTasks 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/SuppressionLists/test.csv</Url>
     </Source>
     <Target>
       <Name>API test import </Name>
       <SuppressionList>80</SuppressionList>
     </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 suppression list import with full options 

Request:

POST https://api.esv2.com/v2/Api/ImportToSuppressionListTasks 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/SuppressionLists/test.csv</Url>
       <Username>username</Username>
       <Password>password</Password>
     <FtpAuth>ExplicitTls</FtpAuth>
     <FtpUseActiveMode>true</FtpUseActiveMode>
     </Source>
     <Target>
       <Name>API test import </Name>
       <SuppressionList>80</SuppressionList>
     </Target>
     <ImportSetup>
       <Mode>Add</Mode>
     <EntryType>DialingPrefix</EntryType>
       <Delimiter>,</Delimiter>
       <Quote>"</Quote>
       <Escape>"</Escape>
       <Comment>|</Comment>
       <Encoding>UTF-8</Encoding> 
     <ColumnNumber>0</ColumnNumber>
     </ImportSetup>
   </Data>
 </ApiRequest>
On this page
To top