Jump to content

How To Delete Product Images Via Web Service

Recommended Posts




I can successfully delete the whole product using this code:

$webService->delete(array('resource' => 'products', 'id' => '11192'));

But I just want to delete the product images and keep the rest of information. I've tryed this way but it doesn't work:

$webService->delete(array('resource' => 'images/products', 'id' => '11192'));

It runs without errors/warnings but don't delete the picture.



Can anyone help me?

Tanks in advance.

Share this post

Link to post
Share on other sites
  • 2 months later...
  • 4 weeks later...
  • 3 years later...
  • 4 months later...

The correct answer is this

Operation: HTTP DELETE
URL : www.shop.com/api/images/products/<product-id>/<image-id>

If you are using the webservice API then 
resource = "images/products/<product-id>"
id = <image-id>

$webService->delete(array('resource' => 'images/products/<product-id>', 'id' => '<image-id>'));


Edited by tobiaseriksson (see edit history)
  • Like 1

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More