Bulk Create Publisher Sources
curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_data": {
"sources": [
{
"name": "Example Source",
"name_slug": "example-source"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource_data: {sources: [{name: 'Example Source', name_slug: 'example-source'}]}
})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/bulk', 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/sources/bulk"
payload = { "resource_data": { "sources": [
{
"name": "Example Source",
"name_slug": "example-source"
}
] } }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, 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/sources/bulk",
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([
'resource_data' => [
'sources' => [
[
'name' => 'Example Source',
'name_slug' => 'example-source'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/publishers/123456/product-db/sources",
"data": [
{
"name": "Example Source",
"name_slug": "example-source",
"object": "product_db_publisher_source",
"self": "/v2/publishers/123456/product-db/sources/10000",
"id": 10000,
"publisher": 123456,
"created_at": "2023-01-01T12:00:00-00:00",
"created_by": null,
"updated_at": null,
"updated_by": null
}
]
}Product DB · Publisher Sources
Bulk Create Publisher Sources
Bulk creates publisher sources for a single publisher. Uses an array of source like the single create above.
POST
/
publishers
/
{publisher_id}
/
product-db
/
sources
/
bulk
Bulk Create Publisher Sources
curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_data": {
"sources": [
{
"name": "Example Source",
"name_slug": "example-source"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource_data: {sources: [{name: 'Example Source', name_slug: 'example-source'}]}
})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/bulk', 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/sources/bulk"
payload = { "resource_data": { "sources": [
{
"name": "Example Source",
"name_slug": "example-source"
}
] } }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, 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/sources/bulk",
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([
'resource_data' => [
'sources' => [
[
'name' => 'Example Source',
'name_slug' => 'example-source'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/publishers/123456/product-db/sources",
"data": [
{
"name": "Example Source",
"name_slug": "example-source",
"object": "product_db_publisher_source",
"self": "/v2/publishers/123456/product-db/sources/10000",
"id": 10000,
"publisher": 123456,
"created_at": "2023-01-01T12:00:00-00:00",
"created_by": null,
"updated_at": null,
"updated_by": null
}
]
}Authorizations
API key en el header Authorization: Basic TU_API_KEY. La key va tal cual, sin codificar en base64. Las credenciales se entregan al comenzar la integración.
Path Parameters
Identifier of the Publisher.
Body
application/json
Show child attributes
Show child attributes
Response
default - application/json
successful operation
For list resources, the value of 'object' will always be 'list'.
Example:
"list"
True if there are more data beyond the offset and limit.
Example:
false
The number of resources to return. Sometimes called 'take'.
Example:
10
The number of resources in sequence to ignore, sometimes called 'skip'.
Example:
0
The URL of the current resource list.
Example:
"/v2/publishers/123456/product-db/sources"
Show child attributes
Show child attributes