Jump to content

No Image Entry In Prestashop Web Service When Creating New Product


seb.luke

Recommended Posts

So, as I am specifying in the title, I am using Prestashop Web Service to add products to my shop. Everything is easy and beautiful with it. I managed to easily add new products to the shop with combinations, categories etc. The problem arises when adding images.


PS's documentation shows how to send images to the API so they will link with the product. For example, if I have a product with ID 150, then using CURL with POST to send an image to /api/images/products/150 will add that image to the product (see here). My issue is as follows: when I create a new product using the PS Web Service API, it returns me the XML containing info about the new product. Let's say that my product ID is 151. When going to /api/images/products the last entry there is 150. So basically adding a new product doesn't add a new entry in the images/products section of the API, so I have nowhere to send the image via CURL. I couldn't find a solution on the internet until now. Does anyone know how to force the webservice to create a /images/products entry with the new product id, or how can I manually create an entry? Any help is appreciated. If further details are needed, please write in the comments and I will add them.


Also if I write the error output of curl to a file, it looks like this: 



* Hostname was found in DNS cache * Trying IP... * Connected to domain.com (IP) port 80 (#0) * Server auth using Basic with user 'KEY' * Connection #0 to host domain.com left intact

 which is not useful for debugging. If for example I add an image manually to the newly created product, I can use my code with no issue whatsoever...


Any help is much appreciated! Thank you.


 


PS: I am using PS v1.6


Edited by seb.luke (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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