Get export request by ID - Fabric
Get export request by ID
cURL
curl --request GET \
--url https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId} \
--header 'Authorization: Bearer <token>' \
--header 'x-site-context: <x-site-context>'
Python
import requests
url = "https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}"
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {
method: 'GET',
headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};
fetch('https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}",
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>",
"x-site-context: <x-site-context>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Java (Unirest)
HttpResponse<String> response = Unirest.get("https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://live.copilot.fabric.inc/api-offers/offers-exports/{exportId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Response Examples
Success Response
{
"exportId": "ab50fe48-5da0-4e77-92d1-bb629eedf19e",
"startedAt": "2023-05-17T21:24:52.398Z",
"status": "IN_PROGRESS",
"type": "REDEMPTION",
"endedAt": "null",
"totalDataExported": 0,
"errors": [],
"filters": [
{
"field": "storeId",
"value": "store001",
"operator": "EQUAL"
}
],
"fileId": "redemption/tenantId/1687472977242-redemption-export.csv"
}
Error Responses
{
"code": "EXPORT_NOT_FOUND",
"message": "The export ID you entered doesn’t exist."
}
{
"code": "UNAUTHORIZED",
"message": "Invalid credentials"
}
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error."
}
Authorizations
AuthorizationBearer <token>: Required authorization header.
Headers
x-site-context
String, required: A JSON object containing the source information for the data pull. Must include account and can optionally include channel, stage, and date for data filtering.
Path Parameters
exportId
String, required: The unique ID generated from the initiate export request.