Jump to content

Update a product's image by webservice


Recommended Posts


I connected my ERP (not in PHP) with a Prestashop 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">
<message><![CDATA[Please set an "image" parameter with image data for value]]></message>

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



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...