Skip to main content

Uploading profiles to a file

Description

Retrieves information about all database or segment profiles.

Contains 3 requests.

1 - creating profiles export task

Request URL

Method: POST

https://example.com/api/v1.1/profiles/get_all

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPItoken
source_typestring"database"
"segment"
YesData source type
source_idint1YesData source ID
file_formatstring"csv"NoExport file format.
By default - csv
custom_requestJSON object{"occupation":"doctor"}NoProfile fields for search
filtering

Request example

{
"token": "e97ce55afc5e4e07bd64afb2227f8a5c",
"source_type": "database",
"source_id": 1,
"file_format": "json"

}

Response example

{
"data": {
"task_id": "task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5"
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
task_idstringExport task ID
errorintError code
error_textstringError text

2 - task status check

Request URL

Method: POST

https://example.com/api/v1.1/tasks/status

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
task_idstring"task_b2f9fk6a-2479-4a63-b592-f15d4e3b69c5"YesExport task ID

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"task_id": "task_b2f9fk6a-2479-4a63-b592-f15d4e3b69c5"

}

Response example

{
"data": {
"status": "success",
"progress": 100,
"result": {
"source_id": 1,
"total": 10,
"type": "database",
"urls": [
"/api/download/6b248de2-39b9-4715-9720-5f4e23f4a296/1_database_export.csv"
]
}
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
statusstringTask status
progressintTask progress
totalintNumber of profiles
urlsarrayExport file link
errorintError code
error_textstringError text

3 - downloading result file

Request URL

Method: GET

https://example.com/api/download/6b248de2-33b9-4715-9720-5f7e23f4a296/1_database_export.csv

The download link is retrieved from the second response.

Request parameters must contain API token.