--- layout: m1x_soap title: Downloadable Link Remove ---
Allows you to remove a link/sample from a downloadable product.
Arguments:
| Type | Name | Description |
|---|---|---|
| string | sessionId | Session ID |
| string | linkId/sampleId | Link/sample ID |
| string | resourceType | Resource type. Can have one of the following values: 'sample' or 'link' |
Return:
| Type | Description |
|---|---|
| boolean | True if the link/sample is removed from a downloadable product |
Faults:
| Fault Code | Fault Message |
|---|---|
| 412 | Link or sample with specified ID was not found. |
| 415 | Validation error has occurred. |
| 416 | Unable to remove link. Details in error message. |
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$sampleId = 7;
$linkId = 9;
$resultSample = $proxy->call(
$sessionId,
'product_downloadable_link.remove',
array($sampleId, 'sample')
);
$resultLink = $proxy->call(
$sessionId,
'product_downloadable_link.remove',
array($linkId, 'link')
);
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary
$result = $proxy->catalogProductDownloadableLinkRemove($sessionId, '7', 'sample');
var_dump($result);
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));
$result = $proxy->catalogProductDownloadableLinkRemove((object)array('sessionId' => $sessionId->result, 'linkId' => '7', 'resourceType' => 'sample'));
var_dump($result->result);