/
catalog_product_attribute_media.remove.html
130 lines (93 loc) · 3.69 KB
/
catalog_product_attribute_media.remove.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
layout: m1x_soap
title: Media Remove
---
<h2><a name="catalog_product_attribute_media.remove-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>
<h4><a name="catalog_product_attribute_media.remove-Resource%3Acatalogproductattributemedia"></a>Resource:catalog_product_attribute_media</h4>
<p><b>Aliases:</b></p>
<ul>
<li>product_attribute_media</li>
<li>product_media</li>
</ul>
<h4><a name="catalog_product_attribute_media.remove-Method%3A"></a>Method:</h4>
<ul>
<li>catalog_product_attribute_media.remove (SOAP V1)</li>
<li>catalogProductAttributeMediaRemove (SOAP V2)</li>
</ul>
<p>Allows you to remove the image from a product.</p>
<p><b>Aliases:</b></p>
<ul>
<li>product_attribute_media.remove</li>
<li>product_media.remove</li>
</ul>
<p><b>Arguments:</b></p>
<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> product\productId <br class="atl-forced-newline" /> </td>
<td> Product ID or SKU </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> file <br class="atl-forced-newline" /> </td>
<td> Image file name (e.g., /b/l/blackberry8100_2.jpg) </td>
</tr>
<tr>
<td> string </td>
<td> identifierType </td>
<td> Defines whether the product ID or SKU is passed in the 'product' parameter </td>
</tr>
</tbody></table>
<p><b>Returns</b>:</p>
<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean\int </td>
<td> True (1) if the image is removed from a product </td>
</tr>
</tbody></table>
<h4><a name="catalog_product_attribute_media.remove-Examples"></a>Examples</h4>
<h5><a name="catalog_product_attribute_media.remove-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');
// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->call($session, 'catalog_product_attribute_media.remove', array('product' => '3', 'file' => '/b/l/blackberry8100_2.jpg'));
var_dump ($result);
// If you don't need the session anymore
//$client->endSession($session);</pre>
</div>
</div></div>
<h5><a name="catalog_product_attribute_media.remove-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
<pre class="theme: Default; brush: php; gutter: false">$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->catalogProductAttributeMediaRemove($sessionId, '3', '/b/l/blackberry8100_2.jpg');
var_dump($result);</pre>
</div>
</div></div>
<h5><a name="catalog_product_attribute_media.remove-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));
$result = $proxy->catalogProductAttributeMediaRemove((object)array('sessionId' => $sessionId->result, 'productId' => '3', 'file' => '/b/l/blackberry8100_2.jpg'));
var_dump($result->result);</pre>
</div>
</div></div>