Shoptrader API docs
Delete - Manufacturers
Met deze API call is het mogelijk om merken te verwijderen. U kunt per merk die u verwijderd opgeven of u de afbeeldingen wilt verwijderen of bewaren.
Parameters
Parameter | Type | Verplicht | Omschrijving |
---|---|---|---|
token | string | Ja | Token, wordt verstrekt door Shoptrader op verzoek |
manufacturers | array | Nee |
Hierin kunt u meerdere manufactureren aangeven die u wilt verwijderen. Wanneer u meerdere manufactureren tegelijk wilt toevoegen dan dient u dit te scheiden door manufacturer1, manufacturer2 enz.
|
PHP Example
<?php
ini_set('max_execution_time', 0);
$strApiBaseUrl = 'uwdomeinnaam.uwdomeinextentie';
$strOutput = 'xml';
$strUrl = 'http://' . $strApiBaseUrl . '/Api/Delete/Manufacturers/?' . $strOutput;
// standaard parameters
$arrParams = array();
$arrParams['token'] = '8f00f89310945a0ca35666c8c9ced2e314e37aa6c32e900932e19902b42208767';
$arrParams['manufacturers'] = array(
'manufacturer1' => array(
'manufacturer_id' => 28, // all required
'keep_image' => 1 // 0 or 1
),
'manufacturer2' => array(
'manufacturer_id' => 29, // all required
'keep_image' => 0 // 0 or 1
)
);
$objCurl = curl_init();
curl_setopt($objCurl, CURLOPT_URL, $strUrl);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($objCurl, CURLOPT_TIMEOUT, 30);
curl_setopt($objCurl, CURLOPT_USERAGENT, 'Shoptrader');
curl_setopt($objCurl, CURLOPT_POST, true);
curl_setopt($objCurl, CURLOPT_POSTFIELDS, http_build_query($arrParams));
// execute cURL, array, xml output
$strCurlData = curl_exec($objCurl);
if ($strCurlData === FALSE) {
echo "cURL Error: " . curl_error($objCurl);
} else {
print_r($strCurlData);
}
// execute cURL, array, xml output
// $strCurlData = curl_exec($objCurl);
// if ($strCurlData === FALSE) {
// echo "cURL Error: " . curl_error($objCurl);
// } else {
// $arrShopResult = json_decode($strCurlData, true);
// print_r($arrShopResult);
// }
?>
Resultaat (array)
<?php
Array (
[manufacturer_28] => Array (
[message] => Array (
[type] => Array (
[success] => Success
)
[success] => Array (
[message] => Manufacturer with ID: 28 deleted successful
)
)
)
)
?>