Download a file by ID - Fabric
Download a file by ID
cURL
curl --request GET \
--url https://api.fabric.inc/v3/catalog-connector-files/actions/download \
--header 'Authorization: Bearer <token>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>'
import requests
url = "https://api.fabric.inc/v3/catalog-connector-files/actions/download"
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)
const options = {
method: 'GET',
headers: {'x-fabric-tenant-id': '<x-fabric-tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.fabric.inc/v3/catalog-connector-files/actions/download', 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.fabric.inc/v3/catalog-connector-files/actions/download",\
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-fabric-tenant-id: <x-fabric-tenant-id>"\
],\
]);
$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.fabric.inc/v3/catalog-connector-files/actions/download"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
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.fabric.inc/v3/catalog-connector-files/actions/download")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/catalog-connector-files/actions/download")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Responses
Success Response
Status Code: 200
Content Type: application/json
Content:
{
"location": "https://pim-v3-dev02-us-east-1-files.s3.us-east-1.amazonaws.com/local/PRODUCT_EXPORT/abc.csv?..."
}
Error Responses
- 400 Bad Request
{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find/create product"
}
]
}
- 401 Unauthorized
{
"type": "UNAUTHORIZED_ERROR",
"message": "Requester is unauthorized"
}
- 403 Forbidden
{
"type": "REQUEST_DENIED",
"message": "User does not have the required permission"
}
- 404 Not Found
{
"type": "NOT_FOUND",
"message": "Resource not found"
}
- 500 Internal Server Error
{
"type": "SERVER_ERROR",
"message": "Internal Server Error"
}
Authorizations
- Authorization
Type: string
Location: header
Required: Yes
This is the authorization token used to authenticate the request. You must pass the access token generated from the system app.