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 | Type | Required | Description |
|---|---|---|---|
| file_name | string | yes | Whole name of the exported file with its extension. |
Request
- CURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/"
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.#### ResponseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("accept", "*/*; version=2");
xhr.send(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Accept: */*; version=2",
"authorization: Token <your_64_char_api_key>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("<your_app_subdomain>.user.com")
payload = ""
headers = { 'authorization': "Token <your_64_char_api_key>", "Accept": "*/*; version=2" }
conn.request("GET", "/api/public/exports/:file_name/download/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
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.com dashboard.\"""