curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/source-targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Publisher Source Target",
"publisher_sources": [
636363,
"example-publisher-source"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Publisher Source Target',
publisher_sources: [636363, 'example-publisher-source']
})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/source-targets', 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/source-targets"
payload = {
"name": "Example Publisher Source Target",
"publisher_sources": [636363, "example-publisher-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/source-targets",
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([
'name' => 'Example Publisher Source Target',
'publisher_sources' => [
636363,
'example-publisher-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;
}{
"name": "Example Publisher Source Target",
"inclusive": true,
"publisher_sources": [
"636363"
],
"object": "product_db_publisher_source_target",
"self": "/v2/publishers/56335/product-db/source_targets/12345",
"id": 12345,
"publisher_source_slugs": [
"example-publisher-source"
],
"created_at": "2023-01-01T00:00:00",
"created_by": null,
"updated_at": null,
"updated_by": null
}Create a Publisher Source Target
Create a Publisher Source Target.
curl --request POST \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/source-targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Publisher Source Target",
"publisher_sources": [
636363,
"example-publisher-source"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Publisher Source Target',
publisher_sources: [636363, 'example-publisher-source']
})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/source-targets', 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/source-targets"
payload = {
"name": "Example Publisher Source Target",
"publisher_sources": [636363, "example-publisher-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/source-targets",
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([
'name' => 'Example Publisher Source Target',
'publisher_sources' => [
636363,
'example-publisher-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;
}{
"name": "Example Publisher Source Target",
"inclusive": true,
"publisher_sources": [
"636363"
],
"object": "product_db_publisher_source_target",
"self": "/v2/publishers/56335/product-db/source_targets/12345",
"id": 12345,
"publisher_source_slugs": [
"example-publisher-source"
],
"created_at": "2023-01-01T00: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
The name of the Publisher Source Target
255"Example Publisher Source Target"
The Publisher Sources to target. Publisher Sources must already exist before creating the target. Can use the Publisher Source ID or Publisher Source Name Slug.
[636363, "example-publisher-source"]
Whether it is an inclusion or an exclusion target. Set to true if inclusion, and false if exclusion. Default value is true.
true
Response
successful operation
The name of the Publisher Source Target
255"Example Publisher Source Target"
Whether it is an inclusion or an exclusion target
true
Array of Publisher Source IDs
["636363"]
A string denoting the current resource being requested or affected.
"product_db_publisher_source_target"
The relative URL of the current resource being requested or affected.
"/v2/publishers/56335/product-db/source_targets/12345"
The current resource identifier (ID).
12345
Array of Publisher Source Name Slugs
["example-publisher-source"]
The timestamp when this resource was created.
"2023-01-01T00:00:00"
The user ID that created this resource.
null
The timestamp when this resource was last updated.
null
The user ID that last updated this resource.
null