cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/customers/exports/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/customers/exports/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/customers/exports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/customers/exports/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/customers/exports/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/customers/exports/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/customers/exports/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"export": {
"id": 123,
"filters": {
"email": "<string>",
"created_at_min": "<string>",
"created_at_max": "<string>",
"updated_at_min": "<string>",
"updated_at_max": "<string>"
},
"created_at": "<string>",
"status": "pending"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": "<string>"
}Exports
Get Export
GET
/
v2
/
customers
/
exports
/
{id}
cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/customers/exports/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/customers/exports/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/customers/exports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/customers/exports/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/customers/exports/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/customers/exports/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/customers/exports/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"export": {
"id": 123,
"filters": {
"email": "<string>",
"created_at_min": "<string>",
"created_at_max": "<string>",
"updated_at_min": "<string>",
"updated_at_max": "<string>"
},
"created_at": "<string>",
"status": "pending"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": "<string>"
}Poll this to follow an export’s progress and to collect its file. A completed
export carries a fresh
download_url on every response, valid for six hours,
so fetch the file soon after reading one, or read this endpoint again for a
new link.
Seven days after completing, the file is deleted and the export reports
expired.Authorizations
An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header
Path Parameters
The ID of the export
Response
200
An export moves from pending to processing to completed, and to expired once its file is deleted seven days later; a run that cannot finish ends failed. Which fields are present depends on its status
- Pending customer export
- Processing customer export
- Completed customer export
- Expired customer export
- Failed customer export
Show child attributes
Show child attributes