seb.luke Posted February 22, 2016 Share Posted February 22, 2016 (edited) 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 February 22, 2016 by seb.luke (see edit history) Link to comment Share on other sites More sharing options...
ElPepito Posted April 4, 2016 Share Posted April 4, 2016 I have the same problem, did you solve it? Greetings Link to comment Share on other sites More sharing options...
seb.luke Posted April 4, 2016 Author Share Posted April 4, 2016 (edited) Hello, Yes, I found a solution and have posted it on StackOverflow as an answer to my question. You can see the answer here. Please upvote it if it helps you, so it can get to the top of the page Edited April 4, 2016 by seb.luke (see edit history) Link to comment Share on other sites More sharing options...
ElPepito Posted April 4, 2016 Share Posted April 4, 2016 Thanks for answering seb.luke, it worked! Link to comment Share on other sites More sharing options...
seb.luke Posted April 5, 2016 Author Share Posted April 5, 2016 I am glad! Good luck! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now