Update a Publisher Source
curl --request PUT \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/{source_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Source",
"name_slug": "example-source"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example Source', name_slug: 'example-source'})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/{source_id}', 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/{source_id}"
payload = {
"name": "Example Source",
"name_slug": "example-source"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(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/{source_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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;
}{
"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
Update a Publisher Source
Update a Publisher Source.
PUT
/
publishers
/
{publisher_id}
/
product-db
/
sources
/
{source_id}
Update a Publisher Source
curl --request PUT \
--url https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/{source_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Source",
"name_slug": "example-source"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example Source', name_slug: 'example-source'})
};
fetch('https://api.hakumedia.ai/v2/publishers/{publisher_id}/product-db/sources/{source_id}', 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/{source_id}"
payload = {
"name": "Example Source",
"name_slug": "example-source"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(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/{source_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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;
}{
"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
}Autorizaciones
Parámetros de ruta
Cuerpo
application/json
A unique, human readable identifier for the Publisher Source. Must contain at least one letter, and can only contain lowercase letters, numbers, and dashes. If it is not provided, it will be auto generated from the name. Special characters will be removed, spaces will be replaced by dashes, and uppercase letters will be converted to lowercase letters.
Maximum string length:
255Ejemplo:
"example-source"
Respuesta
default - application/json
successful operation