cURL
curl -X PUT \
/product-families/{id}/products \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"products": [
""
]
}'import requests
url = "https://coreapi.io/product-families/{id}/products"
payload = { "products": ["ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({products: ['ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b']})
};
fetch('https://coreapi.io/product-families/{id}/products', 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://coreapi.io/product-families/{id}/products",
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([
'products' => [
'ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Product Family
Add products to a product family
Add products to a product family
Required permissions:product-family:writePUT
/
product-families
/
{id}
/
products
cURL
curl -X PUT \
/product-families/{id}/products \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"products": [
""
]
}'import requests
url = "https://coreapi.io/product-families/{id}/products"
payload = { "products": ["ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({products: ['ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b']})
};
fetch('https://coreapi.io/product-families/{id}/products', 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://coreapi.io/product-families/{id}/products",
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([
'products' => [
'ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
ProductFamily identifier
Body
application/jsontext/html
The updated ProductFamily resource
Beispiel:
["ad8f3b9c-1b1a-4b0a-8b0a-0b0b0b0b0b0b"]
Antwort
ProductFamily resource updated
War diese Seite hilfreich?
⌘I