Jobs
Get bulk export status
Poll GET /dn/jobs/export/status/ to check whether an async bulk export is completed and to obtain a time-limited signed download URL.
GET
/
dn
/
jobs
/
export
/
status
/
{id}
Get bulk export status
curl --request GET \
--url https://app.detrack.com/api/v2/dn/jobs/export/status/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/jobs/export/status/{id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://app.detrack.com/api/v2/dn/jobs/export/status/{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://app.detrack.com/api/v2/dn/jobs/export/status/{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 => [
"X-API-KEY: <api-key>"
],
]);
$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://app.detrack.com/api/v2/dn/jobs/export/status/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.detrack.com/api/v2/dn/jobs/export/status/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/jobs/export/status/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"download_url": "https://exports.example.com/shipping-labels.pdf?signature=EXAMPLE_SIGNATURE"
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Could not find an export with this id"
}After you queue a bulk export with Bulk export, poll this endpoint using the
id from the returned status_url. When the export finishes, the response includes a signed download_url that you can use to fetch the generated file.
Polling
- Poll every 5 to 10 seconds. Small exports usually finish within seconds, but large ones can take a few minutes.
- Stop polling as soon as
statusis"completed", then download the file fromdownload_url. - Set an overall timeout in your integration (for example, 10 minutes). If the export still shows
"processing"after that, stop polling and contact Detrack support with the exportid.
Related endpoints
- Bulk export to queue a new export
- Download document to retrieve a single job document directly
Authorizations
Your Detrack API key, from Integrations > API Key in the dashboard.
Path Parameters
Export ID, the last part of status_url.
Example:
"5b22033310c92b1a086ece03"
Get bulk export status
curl --request GET \
--url https://app.detrack.com/api/v2/dn/jobs/export/status/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/jobs/export/status/{id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://app.detrack.com/api/v2/dn/jobs/export/status/{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://app.detrack.com/api/v2/dn/jobs/export/status/{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 => [
"X-API-KEY: <api-key>"
],
]);
$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://app.detrack.com/api/v2/dn/jobs/export/status/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.detrack.com/api/v2/dn/jobs/export/status/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/jobs/export/status/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"download_url": "https://exports.example.com/shipping-labels.pdf?signature=EXAMPLE_SIGNATURE"
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Could not find an export with this id"
}