Delete Files API

To use the Delete Files API:

  1. Create a request and delete specific file:
    curl -X DELETE --header 'Content-Type: application/json' '{document_id}?api_key=API_KEY'
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, '{document_id}?api_key=API_KEY');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    $response = curl_exec($ch);
    // Decode the json object you retrieved when you ran the request.
    $decodedResponse = json_decode($response, true);
    import urllib
    import urllib2
    params = {
        'api_key': 'API_KEY'
    url = '{document_id}?' + urllib.urlencode(params)
    opener = urllib2.build_opener(urllib2.HTTPHandler)
    req = urllib2.Request(url, None)
    req.get_method = lambda: 'DELETE'  # creates the delete method
    response = urllib2.urlopen(req)
    require "net/http"
    require "uri"
    uri = URI.parse("{document_id}?api_key=API_KEY")
    response = Net::HTTP.delete(uri)
    puts response