Upload suppression list data to file
Description
Uploads a csv file containing md5 data from a suppression list.
Includes 3 requests.
Step 1 - creating profiles export task
Request URL
Method: POST
https://example.com/api/v1.1/suppresses/export
Request parameters
| Parameter | Type | Example | Required | Description | 
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token | 
| id | int | 1 | Yes | Suppression list ID | 
| type | string | "emails" "phones" "domains" "all" | No | Type of contact data to export. By default — all. | 
Request example
- JSON
- XML
{
    "token": "abcdefghijklmnqrstuvwxyz",
    "id": 1,
    "type": "emails"
}
<xml>
  <token>abcdefghijklmnqrstuvwxyz</token>
  <id>3</id>
  <type>emails</type>
</xml>
Response example
- JSON
- XML
{
    "data": {
        "task_id": "c110f0-06d0-4695-9aee-a9bab742d"
    },
    "error": 0,
    "error_text": "Successful operation"
}
<xml>
  <data>
    <task_id>c110f0-06d0-4695-9aee-a9bab742d</task_id>
  </data>
  <error>0</error>
  <error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description | 
|---|---|---|
| task_id | string | Export task ID | 
| error | int | Error code | 
| error_text | string | Error text | 
Step 2 - checking export status and getting link
Request URL
Method: POST
https://example.com/api/v1.1/tasks/status
Request parameters
| Parameter | Type | Example | Required | Description | 
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token | 
| task_id | string | "c110f0-06d0-4695-9aee-a9bab742d" | Yes | Export task ID | 
Request example
- JSON
- XML
{
    "token": "abcdefghijklmnqrstuvwxyz",
    "task_id": "c110f0-06d0-4695-9aee-a9bab742d"
}
<xml>
  <token>abcdefghijklmnqrstuvwxyz</token>
  <task_id>c110f0-06d0-4695-9aee-a9bab742d</task_id>
</xml>
Response example
- JSON
- XML
{
    "data": {
        "status": "completed",
        "progress": 100,
        "result": {
            "hashed_file": "suppress/b5bb73d7-530d-4a64-89d4-8ad22bad73/suppress_list_name.md5.zip",
            "is_api": true,
            "regular_file": "",
            "suppress_id": 1,
            "total": 32
        }
    },
    "error": 0,
    "error_text": "Successful operation"
}
<xml>
  <data>
    <status>completed</status>
    <progress>100</progress>
    <xml>
      <hashed_file>suppress/b5bb73d7-530d-4a64-89d4-8ad22bad73/suppress_list_name.md5.zip</hashed_file>
      <is_api>true</is_api>
      <regular_file></regular_file>
      <suppress_id>1</suppress_id>
      <total>32</total>
    </xml>
  </data>
  <error>0</error>
  <error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description | 
|---|---|---|
| status | string | Task status | 
| progress | int | Task progress | 
| hashed_file | array | Link to download the file with data in md5 format | 
| is_api | bool | Export via API | 
| suppress_id | int | Suppression list ID | 
| total | int | Number of lines (email addresses and domains, phones) in the suppression list | 
| error | int | Error code | 
| error_text | string | Error text | 
Step 3 - downloading result file
The link to download the file looks like following:
https://example.com/api/download/suppress/b5bb73d7-530d-4a64-89d4-8ad22bad73/suppress_list_name.md5.zip?token=abcdefghijklmnqrstuvwxyz
, where:
- https://example.com- link to the platform panel
- api/download/suppress/b5bb73d7-530d-4a64-89d4-8ad22bad73/suppress_list_name.md5.zip- link from the- urlsparameter of the past request
- ?token=abcdefghijklmnqrstuvwxyz- user's API token (after the equal sign).
To download a file with profiles you should either open this link in your browser or send an empty GET request specifying this link in the URL.