curl --request PUT \
--url https://sandbox.circularo.com/api/v1/share/document/preview/{hash}import requests
url = "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://sandbox.circularo.com/api/v1/share/document/preview/{hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.circularo.com/api/v1/share/document/preview/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/share/document/preview/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body{
"content": "p7kd2m4s9xq1v8b3n6c0z5w2e7r4t1y9u3i6o8a2s5d7f0g4h1j3k6l9z2x5c8v0b4",
"failureReason": "conversion_error",
"hash": "as0ia4jdqecwq0u5s1omd9krs4u244ic2n2545kyhyat9imkwyg1bgec16r94tth",
"status": "failed_irrecoverable",
"statusDate": "2023-11-07T05:31:56Z"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 428,
"type": "AUTH:MFA_REQUIRED",
"message": "MFA activation required",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Request the PDF preview of a shared document's file
PUT /share/document/preview/{hash}
Makes sure an office file of the shared document has a PDF preview, and answers with where the preview stands. Only a file this share gives access to qualifies, and its preview is then downloadable through the share like the file itself.
The document is not changed. The call waits for the preview: it answers as soon as the preview is finished or has failed. A preview that takes longer than the server lets a request wait is answered with status in_progress, and the call is then simply made again. A final status is finished, with content identifying the PDF, or one of the failed states.
Share authorization: Authorize using a share token and a one-time password (if required) to call this endpoint.
Allowed share object types: document
Allowed share purposes: view or edit or sign or execute or accept or approve or review
curl --request PUT \
--url https://sandbox.circularo.com/api/v1/share/document/preview/{hash}import requests
url = "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://sandbox.circularo.com/api/v1/share/document/preview/{hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/share/document/preview/{hash}"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.circularo.com/api/v1/share/document/preview/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/share/document/preview/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body{
"content": "p7kd2m4s9xq1v8b3n6c0z5w2e7r4t1y9u3i6o8a2s5d7f0g4h1j3k6l9z2x5c8v0b4",
"failureReason": "conversion_error",
"hash": "as0ia4jdqecwq0u5s1omd9krs4u244ic2n2545kyhyat9imkwyg1bgec16r94tth",
"status": "failed_irrecoverable",
"statusDate": "2023-11-07T05:31:56Z"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 428,
"type": "AUTH:MFA_REQUIRED",
"message": "MFA activation required",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Path Parameters
Query Parameters
Response
Returns where the preview of the file stands.
Why the last attempt to generate the preview failed; empty unless it failed.
conversion_error: The converter could not read the file, for example because it is damaged or its content does not match its type.file_too_large: The file is larger than the biggest file a PDF preview is generated for.service_error: The conversion service failed or could not be reached.timeout: The conversion did not finish in time.
conversion_error, file_too_large, service_error, timeout, null Where generating the preview stands.
failed_irrecoverable: The file cannot be turned into a PDF preview - its content was rejected or it is too large - and it is not tried again.failed_recoverable: The last attempt failed for a reason that may pass, such as a timeout or an unavailable conversion service. The next request for the preview tries again once the retry cooldown has passed.finished: The PDF preview is ready andcontentidentifies it.in_progress: The PDF preview is being generated.
failed_irrecoverable, failed_recoverable, finished, in_progress, null