Get import reports
ImportReports collection allows retrieving information about imports to subscribers list, suppressions list, blacklist or data tables.
Request data format
Request URL parameters:
Parameter | Type | Notes |
---|---|---|
apiKey | string | Your API key, required for authentication. Required. |
reportType | string | Required parameter. Type of data to retrieve. Supported report types are: Subscribers, Suppressions, Blacklist, DataTables. |
startDate | date | Start date. Optional. Both parameters (startDate, endDate) are required to specify report range. Otherwise they are ignored. YYYY-MM-DD format. |
endDate | date | See startDate. |
scheduledTaskId | int | Optional. Scheduled Task which launched import. |
listId | int | Optional. Subscriber list ID where was import targeted. Taken with reportType = Subscribers. Otherwise ignored. |
suppressionListId | int | Optional. Suppression list ID where was import targeted. Taken with reportType = Suppressions. Otherwise ignored. |
Example:
https://api.esv2.com/v2/Api/ImportReports?ReportType=Suppressions&apiKey=YOUR_API_KEY_HERE&StartDate=2017-10-27
https://api.esv2.com/v2/Api/ImportReports?ReportType=Subscribers&apiKey=YOUR_API_KEY_HERE&ScheduledTaskID=3344&StartDate=2017-10-26&EndDate=2017-10-28&ListId=7459
Response
Response Data element:
Element/attribute | Type | Notes |
---|---|---|
ImportReports | array[complex] | Array of ImportReports elements. |
ImportReport element children:
Element/attribute | Type | Notes |
---|---|---|
Id | int | Import identifier. |
FileName | string | Name of file used for import source. |
ImportDate | date | Date of import execution. |
FinishedDate | date | Date of import finished execution(only for subscriber and data table imports). |
ListId | int | Subscribers or suppressions list ID. |
ListName | string | Subscribers or suppressions list name. |
ImportType | string | Selected import mode. |
MatchingMode | string | Selected import key. |
ScheduledTaskId | int | Scheduled task which launched import. |
TotalRows | int | Total number of rows found in import file. |
ValidRows | int | Number of valid rows found in import file. |
InvalidRows | int | Number of invalid rows found in import file. |
ConflictingRecords | int | Number of conflicts with existing subscribers. |
DuplicatedRows | int | Number of duplicated rows found in import file. |
Entries | complex | Entries element containing statistics grouped by import key type. |
Subscriptions | complex | Subscriptions element containing detailed statistics grouped by channel. |
Status | string | Task completion status. |
ErrorDescription | string | Description of data table error if occurs. |
Entries element:
Element/attribute | Type | Notes |
---|---|---|
complex | Detailed statistics for Email import key. | |
Phone | complex | Detailed statistics for Phone import key. |
CustomSubscriberId | complex | Detailed statistics for CustomSubscriberId import key. |
Email/Phone/CustomSubscriberId elements’ children:
Element/attribute | Type | Notes |
---|---|---|
Valid | int | Number of valid entries found. |
Invalid | int | Number of invalid entries found. |
Duplicated | int | Number of duplicated entries found. |
Empty | int | Number of empty entries found. |
Subscriptions element:
Element/attribute | Type | Notes |
---|---|---|
complex | Detailed subscription statistics for Email channel. | |
Phone | complex | Detailed subscription statistics for Phone channel. |
Subscriptions’ element children:
Element/attribute | Type | Notes |
---|---|---|
Added | int | Number of added entries. |
Updated | int | Number of updated entries. |
Replaced | int | Number of replaced entries. |
SystemRejected | int | Number of entries rejected by the system. |
Blacklisted | int | Number of blacklisted entries. |
Unsubscribed | int | Number of unsubscriptions. |
Example
DataTables import
Request:
GET https://api.esv2.com/v2/Api/ImportReports?ReportType=DataTables&apiKey= YOUR_API_KEY_HERE&StartDate=2017-10-31 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=znbbf255rwgtzketrup04q55; path=/; HttpOnly
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 31 Oct 2014 11:05:25 GMT
Content-Length: 651
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<ImportReports>
<ImportReport>
<Id>137</Id>
<FileName>test_importu.csv</FileName>
<ImportDate>2014-10-31T07:21:33</ImportDate>
<FinishedDate>2014-10-31T07:35:26.283</FinishedDate>
<ImportType>Synchronize table with import file</ImportType>
<ScheduledTaskId>3347</ScheduledTaskId>
<AddedEntries>0</AddedEntries>
<Status>Error</Status>
<ErrorDescription>Nie ma tabeli o podanej nazwie pliku: test_importu.csv</ErrorDescription>
</ImportReport>
</ImportReports>
</Data>
</ApiResponse>
Subscribers import
Request:
GET https://api.esv2.com/v2/Api/ImportReports?ReportType=Subscribers&apiKey= YOUR_API_KEY_HERE&StartDate=2017-10-31 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=znbbf255rwgtzketrup04q55; path=/; HttpOnly
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 31 Oct 2014 11:05:25 GMT
Content-Length: 651
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<ImportReports>
<ImportReport>
<Id>125</Id>
<FileName>test_importu.csv</FileName>
<ImportDate>2017-11-10T07:21:33</ImportDate>
<FinishedDate>2017-11-10T07:35:26.283</FinishedDate>
<ListId>29</ListId>
<ListName>List_123</ListName>
<ImportType>Add new subscribers and update data of subscribers existing on the list</ImportType>
<MatchingMode>Email</MatchingMode>
<TotalRows>41</TotalRows>
<ValidRows>34</ValidRows>
<InvalidRows>3</InvalidRows>
<ConflictingRecords>4</ConflictingRecords>
<DuplicatedRows>0</DuplicatedRows>
<Entries>
<Email>
<Valid>38</Valid>
<Duplicated>0</Duplicated>
<Invalid>3</Invalid>
<Empty>0</Empty>
</Email>
<Phone>
<Valid>41</Valid>
<Duplicated>0</Duplicated>
<Invalid>0</Invalid>
<Empty>0</Empty>
</Phone>
<CustomSubscriberId>
<Valid>0</Valid>
<Duplicated>0</Duplicated>
<Invalid>0</Invalid>
<Empty>0</Empty>
</CustomSubscriberId>
</Entries>
<Subscriptions>
<Email>
<Added>4</Added>
<Updated>33</Updated>
<Replaced>0</Replaced>
<SystemRejected>0</SystemRejected>
<Blacklisted>1</Blacklisted>
<Unsubscribed>0</Unsubscribed>
</Email>
<Phone>
<Added>35</Added>
<Updated>0</Updated>
<Replaced>0</Replaced>
<SystemRejected>1</SystemRejected>
<Blacklisted>5</Blacklisted>
<Unsubscribed>0</Unsubscribed>
</Phone>
</Subscriptions>
</ImportReport>
</ImportReports>
</Data>
</ApiResponse>