Jump to content

Update a product's image by webservice


JCV

Recommended Posts

Hello,

I connected my ERP (not in PHP) with a Prestashop 1.7.4.4 by using WEBSERVICES.

I use CURL in command line to communicate with the webshop.

I can send and update Categories, Manufacturers and Products.

I can insert and delete images but I can't update them 😞

Here how I send images to a product (POST)

We suppose that product ID is 10.

c:\curl\curl.exe -k -X POST -F [email protected] -u MYKEYXXXXXXXXX: https://www.mysite.com/shop/api/images/products/10 -o c:\tmp\answer.xml

It runs well, I received an XML answer with the ID of the image, and the image. I thing sending back the image is not necessary , communication will be faster.

Here how I try to update the image (PUT)

We suppose that product ID is 10 and the image to update is 15.

c:\curl\curl.exe -k -X PUT -F [email protected] -u MYKEYXXXXXXXXX: https://www.mysite.com/shop/api/images/products/10/15 -o c:\tmp\answer.xml

I receive this message :

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code><![CDATA[76]]></code>
<message><![CDATA[Please set an "image" parameter with image data for value]]></message>
</error>
</errors>
</prestashop>

Could Somebody help me to solve my problem or tell where I can find help ?

I also would like to send a legend but I don't see the solution. 

Thank you

JC

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...