Delete Files

How do I delete a file?

To delete a file, make a POST request to the /files/[replace file id here]/delete endpoint.

This will take a second to fully delete your file from our cloud storage service, then respond with a JSON response containing success: true.

Example response:

    
{
  "success": true
}
    
    

Ruby code to delete a file:

      
require 'net/http'
require 'uri'

uri = URI.parse("https://api1.docalysis.com/api/v1/files/[file id]/delete")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer your_api_key_here"

req_options = {
  use_ssl: true,
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body