GET/ api/ public/ exports/ :file_name/ download/
Download exported data
You can return all data from the specifc file by using its name. The name of a file might be returned in response to started export or from the list of exported data.
Attributes
Optional unless marked required
- file_name
- Whole name of the exported file with its extension.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
- 423
first_name,last_name,email,gender,status,assigned_to,companies,user_id,deals,phone_number,last_ip,last_contacted,hostname,referrer,url,timezone,city,country,unsubscribed,browser_language,score,browser,os_type,resolution,tags,facebook_url,linkedin_url,twitter_url,google_url,custom_attribute_1,custom_attribute_2
John,Doe,myemail@example.org,1,1,2,,my_id,,48123456789,11.22.11.22,2016-08-22T13:03:12.198898Z,myhostname.com,https://google.com,https://example.org,Europe/Warsaw,New York,United States,TRUE,en,2342,Firefox,Windows,1903x693,those|are|four|tags,http://facebook.com,http://linkedin.com,http://twitter.com,http://google.com,value as a string,"\""this value will be also a string, to change data type of custom attributes - you need to first create them via User dashboard.\"""
{
"error": "File not found"
}
{
"message": "Export not finished yet."
}
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.