meta data for this page
Delete file(s) from User's Storage Area
Use the DELETE /files{/path/to/a/file}
transaction to delete a file or a folder from the user's storage area.
Synopsis
- Method: DELETE
- Target: https://api.ensims.com/users/api/files{/path/to/a/file}
- Cookie: “session_token=<existing JWT>”
- Header: none
- Body: none
- Success: Transaction return object
- Error: HTTP 401 - Unauthorized
Transaction return object
A successful transaction return object contains the status flag and a message, as shown below.
{ "ok" : true, "status": "test/today/test123.txt has been deleted" }
If the target does not exist or cannot be deleted, the transaction returns an object containing a false
flag and a message, as shown below.
{ "ok" : false, "status": "test/today/test123.txt is not found or cannot be deleted" }
Example using curl://
Send the /user
command using curl:
curl -b cookies -X DELETE https://api.ensims.com/users/api/test/today/test123.txt
On success, the contents of the file are returned. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.
Example using Python Requests
Make sure Requests is correctly installed in your Python environment, and run the following lines:
import requests # Existing cookies are expected to be stored in the variable 'cookies' r = requests.delete('https://api.ensims.com/users/api/files/test/today/test123.txt', cookies=cookies) # Show the returned object r.json()