Bulk Upload a Catalog CSV
curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "product-db-catalog-bulk-upload-response",
"status": "success"
}Product DB · Catalog Items · Bulk Upload
Bulk Upload a Catalog CSV
Bulk upload a catalog CSV with column names that match the fields submitted to a catalog. Submitting a bulk upload moves the catalog into an IMPORT state, thus preventing modification of the catalog itself, or any catalog items until the import is complete. Subsequent bulk uploads behave much like bulk add & update combined - new items will be added, existing items will be updated. No items will be deleted.
POST
/
publishers
/
{publisher_id}
/
product-db
/
catalogs
/
{catalog_id}
/
items
/
bulk-upload
Bulk Upload a Catalog CSV
curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/catalogs/{catalog_id}/items/bulk-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "product-db-catalog-bulk-upload-response",
"status": "success"
}Autorizaciones
Parámetros de ruta
Cuerpo
multipart/form-data
A JSON string of key-value pairs to assist in the bulk upload process.
Currently accepts:
- overwrite: whether to replace the existing catalog data or add to the existing data. When set to `0`, catalog items in the uploaded CSV that don't exist in the existing data will be added, and changes to existing data from the CSV will be applied. When set to `1`, the existing catalog data will be removed completely and replaced with the CSV contents.