deletehttps://api.pixlab.io/delete
Description
Remove a previously stored media file. All your processed media files are stored by default on pixlab.xyz unless you set your own AWS S3 key (refer to your dashboard on how to do that). In which case, everything shall be stored on your own S3 bucket.
HTTP Methods
GET
Request Parameters
Required
Fields | Type | Description |
---|---|---|
link | URL | Target media URL or Unique media ID. |
key | String | Your PixLab API Key. You can also embed your key in the WWW-Authenticate: HTTP header and omit this parameter if you want to. |
Response
application/json.
This command always return a JSON object after each call. The following are the JSON fields returned in response body:
Fields | Type | Description |
---|---|---|
status | Integer | Status code 200 indicates success, any other code indicates failure. |
id | String | Unique media ID. |
deleted | Boolean | Result of the delete operation. |
error | String | Error message if status != 200. |
Python Example
import requests
import json
# Generate an oilpaint pic and delete it
req = requests.get('https://api.pixlab.io/oilpaint',params={'img':'http://cf.broadsheet.ie/wp-content/uploads/2015/03/jeremy-clarkson_3090507b.jpg','radius':3,'key':'My_PixLab_Key'})
reply = req.json()
if reply['status'] != 200:
print (reply['error'])
exit()
print ("Deleting: "+ reply['link'] +"...")
req = requests.get('https://api.pixlab.io/delete',params={'link':reply['link'],'key':'My_PixLab_Key'})
reply = req.json()
if reply['status'] != 200:
print (reply['error'])
else:
print ("Deletion succeed")