0

I'm trying to use the Imageshack api to delete an image uploaded to my account.

I have successfully managed to upload an image to it using the API.

https://www.imageshack.us/upload_api.php?url=[URL_OF_THE_IMAGE]&key=[MY_KEY]

I can delete the image uploaded by using the standard interface.

Any solution using the API?

Buntu Linux
  • 492
  • 9
  • 19

2 Answers2

0

I have managed it by doing the following:

First log in to get an auth_token:

HTTP POST
https://api.imageshack.us/v1/user/login?username=YOUR_USERNAME&password=YOUR_PASSWORD

Parse "auth_token" from the response

Then delete:

HTTP DELETE
https://api.imageshack.us/v1/images/SERVER/FILENAME?auth_token=AUTHTOKEN

In addition to AUTHTOKEN you need include SERVER and FILENAME, I store these from files.server and files.image.filename that come back in the response to the upload API call.

0

Jamie Clark's solution is what you need, using the proper v1 api. Your sample script is still using the posting methodology from their older API as described here. That one doesn't expose any deletion methods. What Jamie is describing is the API as it is currently, documented here. It's not clear if the API keys are the same, but I'm guessing no - my new one doesn't seem to work with this old call and the link from that google code page for requesting an API key is defunct.

Don
  • 109
  • 2