Skip to main content

Delete Endpoint

Introduction

The DELETE /delete/:filename endpoint allows you to securely delete files you have previously uploaded to the server. This guide provides detailed instructions on how to use the delete endpoint, including required headers, parameters, and example requests.

Endpoint

DELETE /delete/:filename

Request Headers

  • x-auth-name: Your customer name.
  • x-auth-password: Your customer password.

URL Parameters

  • filename: The name of the file to be deleted. This should be specified in the URL.

Response

  • 200 OK: If the file is found and successfully deleted.
  • 400 Bad Request: If authentication fails, the file is not found, or the filename parameter is missing.

Example Requests

Using curl

Deleting a File

curl -X DELETE http://yourserver.com/delete/yourfile.txt \
  -H "x-auth-name: yourname" \
  -H "x-auth-password: yourpassword"

Example Response

Successful Deletion

OK

Error Response

If the request is malformed, authentication fails, or the file is not found, the API will return an error message with a 400 Bad Request status.

Example Error Response

If the filename parameter is missing:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "No filename. Use /delete/<filename>"
}

If the file is not found:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "File not found"
}