curl --request POST \
--url https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"fileName": "item-attributes.csv"
}
'import requests
url = "https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute"
payload = { "fileName": "item-attributes.csv" }
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-site-context': '<x-site-context>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fileName: 'item-attributes.csv'})
};
fetch('https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute', 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://live.copilot.fabric.inc/api-product/v1/upload-url/attribute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileName' => 'item-attributes.csv'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute"
payload := strings.NewReader("{\n \"fileName\": \"item-attributes.csv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"item-attributes.csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"item-attributes.csv\"\n}"
response = http.request(request)
puts response.read_body{
"fileId": "626c415430548500093811f1",
"url": "https://demo-dev02-bulk-import-pim.s3.amazonaws.com/attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA26KLJWUAC474VT4E%2F20220429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220429T194940Z&X-Amz-Expires=300&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDwaCXVzLWVhc3QtMSJHMEUCIQCesp8JqH%2F%2F3QZP%2BcybG392bRrSI2d%2BHbBfYknEgqDuXAIgStf8iZndc9fOzokQimbgivAGx1hum81ZVqKbxFuigaMqsAII9f%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgw3NTIzMTQwNzAyNzIiDE7VWWdAw%2BMtShgibSqEAtJrxQ%2B0h7Bu9DE3FcCGCi4fyAoLxtkAFRUWQ28ciZDvS5PC%2BU4%2FOvjuXSttg%2Bz%2F8E3Ff0QqI8%2BWOOG02O4DQSpUEc9aDBqXFVB2nezNz6CCyoIhlxRhHJXrjboktovlKAHnRpB0KRgHo7B05v2%2BM9z49w%2FzFrB%2FrW5XF0bFMyYGsm3aK0%2B4C8kS9oJ0dDxaKYxe%2BaKrn0XmcBLBduu3fL2h6WRhv29%2FDQxmwDO9O%2FNXfYAxnB2iQYAo2ZuL8ujcyDQPp2zNLFYiwQpQYE4DhVCT2CDw1SJU7xTi3ZHYDmt7xfe2vgwKxPolZumOIVIhBa7%2Fj7tma%2FbuX%2BAjKHUFnBfMnE5oMPuBsZMGOpoBWHVtEmbAx%2FsCaUu9jpSJoHgNkIDwxVGvV2XPPoNJIhLg9aCC2cMnAkRbbLOplmV4fnWmsY15Hdjd6CIhX5fCKGv2gLJCs6XpanNOm89KI8Ro9q4Gh5MvytJlSIEXuYgBI%2B2%2FWF5iNF0%2BUZX7cNtZjLK7yXHytJP94f0vF%2BqbAIpG%2FT9yyn1Z9KKWyMeIpCYsAsEY%2F1seiB6slA%3D%3D&X-Amz-Signature=b029ce0c5158f33fc4867d6a40f59d133d15d34fb300615e6c74b7414f8fe668&X-Amz-SignedHeaders=host%3Bx-amz-meta-account%3Bx-amz-meta-channel%3Bx-amz-meta-fileid%3Bx-amz-meta-filename%3Bx-amz-meta-prefix%3Bx-amz-meta-stage%3Bx-amz-meta-user&x-amz-meta-account=60ac19ef893ab1000864b771&x-amz-meta-channel=&x-amz-meta-fileid=626c415430548500093811f1&x-amz-meta-filename=item-attributes.csv&x-amz-meta-prefix=attribute&x-amz-meta-stage=dev02",
"key": "attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv"
}{
"code": 400,
"message": "Client error"
}{
"code": 500,
"message": "An internal error occurred. If the issue persists please contact support@fabric.inc."
}Generate S3 bucket URL for item attribute import
Generates S3 bucket URL to upload item attribute using CSV file
curl --request POST \
--url https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"fileName": "item-attributes.csv"
}
'import requests
url = "https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute"
payload = { "fileName": "item-attributes.csv" }
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-site-context': '<x-site-context>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fileName: 'item-attributes.csv'})
};
fetch('https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute', 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://live.copilot.fabric.inc/api-product/v1/upload-url/attribute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileName' => 'item-attributes.csv'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute"
payload := strings.NewReader("{\n \"fileName\": \"item-attributes.csv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"item-attributes.csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.copilot.fabric.inc/api-product/v1/upload-url/attribute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"item-attributes.csv\"\n}"
response = http.request(request)
puts response.read_body{
"fileId": "626c415430548500093811f1",
"url": "https://demo-dev02-bulk-import-pim.s3.amazonaws.com/attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA26KLJWUAC474VT4E%2F20220429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220429T194940Z&X-Amz-Expires=300&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDwaCXVzLWVhc3QtMSJHMEUCIQCesp8JqH%2F%2F3QZP%2BcybG392bRrSI2d%2BHbBfYknEgqDuXAIgStf8iZndc9fOzokQimbgivAGx1hum81ZVqKbxFuigaMqsAII9f%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgw3NTIzMTQwNzAyNzIiDE7VWWdAw%2BMtShgibSqEAtJrxQ%2B0h7Bu9DE3FcCGCi4fyAoLxtkAFRUWQ28ciZDvS5PC%2BU4%2FOvjuXSttg%2Bz%2F8E3Ff0QqI8%2BWOOG02O4DQSpUEc9aDBqXFVB2nezNz6CCyoIhlxRhHJXrjboktovlKAHnRpB0KRgHo7B05v2%2BM9z49w%2FzFrB%2FrW5XF0bFMyYGsm3aK0%2B4C8kS9oJ0dDxaKYxe%2BaKrn0XmcBLBduu3fL2h6WRhv29%2FDQxmwDO9O%2FNXfYAxnB2iQYAo2ZuL8ujcyDQPp2zNLFYiwQpQYE4DhVCT2CDw1SJU7xTi3ZHYDmt7xfe2vgwKxPolZumOIVIhBa7%2Fj7tma%2FbuX%2BAjKHUFnBfMnE5oMPuBsZMGOpoBWHVtEmbAx%2FsCaUu9jpSJoHgNkIDwxVGvV2XPPoNJIhLg9aCC2cMnAkRbbLOplmV4fnWmsY15Hdjd6CIhX5fCKGv2gLJCs6XpanNOm89KI8Ro9q4Gh5MvytJlSIEXuYgBI%2B2%2FWF5iNF0%2BUZX7cNtZjLK7yXHytJP94f0vF%2BqbAIpG%2FT9yyn1Z9KKWyMeIpCYsAsEY%2F1seiB6slA%3D%3D&X-Amz-Signature=b029ce0c5158f33fc4867d6a40f59d133d15d34fb300615e6c74b7414f8fe668&X-Amz-SignedHeaders=host%3Bx-amz-meta-account%3Bx-amz-meta-channel%3Bx-amz-meta-fileid%3Bx-amz-meta-filename%3Bx-amz-meta-prefix%3Bx-amz-meta-stage%3Bx-amz-meta-user&x-amz-meta-account=60ac19ef893ab1000864b771&x-amz-meta-channel=&x-amz-meta-fileid=626c415430548500093811f1&x-amz-meta-filename=item-attributes.csv&x-amz-meta-prefix=attribute&x-amz-meta-stage=dev02",
"key": "attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv"
}{
"code": 400,
"message": "Client error"
}{
"code": 500,
"message": "An internal error occurred. If the issue persists please contact support@fabric.inc."
}Authorizations
S2S access token (JWT) from fabric Identity service (during Login)
Headers
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Body
File name to be uploaded in the generated URL
"item-attributes.csv"
Response
OK
A 24-character system-generated file ID
"626c415430548500093811f1"
S3 bucket url, to upload the template file.
"https://demo-dev02-bulk-import-pim.s3.amazonaws.com/attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA26KLJWUAC474VT4E%2F20220429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220429T194940Z&X-Amz-Expires=300&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDwaCXVzLWVhc3QtMSJHMEUCIQCesp8JqH%2F%2F3QZP%2BcybG392bRrSI2d%2BHbBfYknEgqDuXAIgStf8iZndc9fOzokQimbgivAGx1hum81ZVqKbxFuigaMqsAII9f%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgw3NTIzMTQwNzAyNzIiDE7VWWdAw%2BMtShgibSqEAtJrxQ%2B0h7Bu9DE3FcCGCi4fyAoLxtkAFRUWQ28ciZDvS5PC%2BU4%2FOvjuXSttg%2Bz%2F8E3Ff0QqI8%2BWOOG02O4DQSpUEc9aDBqXFVB2nezNz6CCyoIhlxRhHJXrjboktovlKAHnRpB0KRgHo7B05v2%2BM9z49w%2FzFrB%2FrW5XF0bFMyYGsm3aK0%2B4C8kS9oJ0dDxaKYxe%2BaKrn0XmcBLBduu3fL2h6WRhv29%2FDQxmwDO9O%2FNXfYAxnB2iQYAo2ZuL8ujcyDQPp2zNLFYiwQpQYE4DhVCT2CDw1SJU7xTi3ZHYDmt7xfe2vgwKxPolZumOIVIhBa7%2Fj7tma%2FbuX%2BAjKHUFnBfMnE5oMPuBsZMGOpoBWHVtEmbAx%2FsCaUu9jpSJoHgNkIDwxVGvV2XPPoNJIhLg9aCC2cMnAkRbbLOplmV4fnWmsY15Hdjd6CIhX5fCKGv2gLJCs6XpanNOm89KI8Ro9q4Gh5MvytJlSIEXuYgBI%2B2%2FWF5iNF0%2BUZX7cNtZjLK7yXHytJP94f0vF%2BqbAIpG%2FT9yyn1Z9KKWyMeIpCYsAsEY%2F1seiB6slA%3D%3D&X-Amz-Signature=b029ce0c5158f33fc4867d6a40f59d133d15d34fb300615e6c74b7414f8fe668&X-Amz-SignedHeaders=host%3Bx-amz-meta-account%3Bx-amz-meta-channel%3Bx-amz-meta-fileid%3Bx-amz-meta-filename%3Bx-amz-meta-prefix%3Bx-amz-meta-stage%3Bx-amz-meta-user&x-amz-meta-account=60ac19ef893ab1000864b771&x-amz-meta-channel=&x-amz-meta-fileid=626c415430548500093811f1&x-amz-meta-filename=item-attributes.csv&x-amz-meta-prefix=attribute&x-amz-meta-stage=dev02"
S3 key of the file
"attribute/60ac19ef893ab1000864b771/dev02/1651261780352-item-attributes.csv"
Was this page helpful?
