Get file upload status - Fabric
Get file upload status
cURL
curl --request GET \
--url https://live.copilot.fabric.inc/api-product/v1/product/bulk/file/{fileId}/status \
--header 'Authorization: Bearer <token>' \
--header 'x-site-context: <x-site-context>'
Python
import requests
url = "https://live.copilot.fabric.inc/api-product/v1/product/bulk/file/{fileId}/status"
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {
method: 'GET',
headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};
fetch('https://live.copilot.fabric.inc/api-product/v1/product/bulk/file/{fileId}/status', 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-product/v1/product/bulk/file/{fileId}/status",
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-product/v1/product/bulk/file/{fileId}/status"
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))
}
Unirest (Java)
HttpResponse<String> response = Unirest.get("https://live.copilot.fabric.inc/api-product/v1/product/bulk/file/{fileId}/status")
.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-product/v1/product/bulk/file/{fileId}/status")
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
Example Response
- Successful Response:
{
"createdOn": "2021-09-14T22:10:30.618Z",
"name": "Duplicate+New+Dup.csv",
"csvLink": "https://demo-dev02-bulk-import-pim.s3.amazonaws.com/item-bundles/609ac75051f11a0007cf38b3/dev02/1651266490891-men-shoes-bundle-local.csv",
"errorCsv": "https://demo-dev02-bulk-import-pim.s3.amazonaws.com/item-bundles/609ac75051f11a0007cf38b3/dev02/1651266490891-error.zip",
"statuses": [
{
"code": "FILE_PROGRESS_COMPLETE",
"description": "Import successful",
"name": "file progress is complete"
}
]
}
- Error Responses:
{
"code": 400,
"message": "Client error"
}
{
"code": 500,
"message": "An internal error occurred. If the issue persists please contact support@fabric.inc."
}
Authorization
- S2S access token (JWT) from fabric Identity service (during Login)
Headers
x-site-context: JSON object containing source information needed.
Path Parameters
fileId: A 24-character system-generated file ID.Response
200: application/json OK
400: Client error
500: An internal error occurred.