You use the Clean File API to Clean the document:
#!/bin/bash
curl -X GET --header 'Content-Type: application/json' 'https://fax.to/api/v2/file-clean?document_id=DOCUMENT_ID&api_key=API_KEY'
<?php
$targetUrl = 'https://fax.to/api/v2/file-clean?document_id=DOCUMENT_ID&api_key=API_KEY';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$targetUrl);
curl_setopt($ch, CURLOPT_POST,0);
$response = curl_exec($ch);
// Decode the json object you retrieved when you ran the request.
$decodedResponse = json_decode($response, true);
var_dump($decodedResponse);
import urllib
params = {
'api_key': 'API_KEY'
'document_id': 'DOCUMENT_ID'
}
url = 'https://fax.to/api/v2/file-clean?' + urllib.urlencode(params)
response = urllib.urlopen(url)
print response.read()
require "net/http"
require "uri"
uri = URI.parse("https://fax.to/api/v2/file-clean?document_id=DOCUMENT_ID&api_key=API_KEY")
response = Net::HTTP.get(uri)
puts response
{
"status": "success",
"file_extension": "pdf",
"filename": "59a5152b95cc1.pdf.tiff",
"filename_uploaded": "pdf-sample.pdf",
"filesize": 485432,
"id": 327,
"orig_filename": "59a5152b95cc1.pdf",
"preview_file": "59a5152b95cc1.pdf.preview.jpg",
"preview_image": null,
"preview_in_storage": 1,
"s3": null,
"server_document_id": null,
"team_user_id": null,
"total_pages": 1,
"updated_at": "2017-08-29 07:18:05",
"user_id": 1,
"created_at": "2017-08-29 07:18:05",
}