curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=' \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213",
"signedFiles": [
{
"originalFile": "40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun",
"signedFile": "2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco"
}
],
"tsaServer": "primary",
"useTsa": false
}
'import requests
url = "https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token="
payload = {
"sessionId": "sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213",
"signedFiles": [
{
"originalFile": "40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun",
"signedFile": "2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco"
}
],
"tsaServer": "primary",
"useTsa": False
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: 'sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213',
signedFiles: [
{
originalFile: '40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun',
signedFile: '2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco'
}
],
tsaServer: 'primary',
useTsa: false
})
};
fetch('https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=', 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/documents/sign/finish/file?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => 'sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213',
'signedFiles' => [
[
'originalFile' => '40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun',
'signedFile' => '2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco'
]
],
'tsaServer' => 'primary',
'useTsa' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token="
payload := strings.NewReader("{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
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/documents/sign/finish/file?token=")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 402,
"type": "SUBSCRIPTION:NOT_ACTIVE",
"message": "Subscription not active",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 410,
"type": "AUTH:IDENTITY_TOKEN_EXPIRED",
"message": "Identity token expired",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Finish two-step file signing of a document
PUT /documents/sign/finish/file
Completes a client-side signing session opened by POST /documents/sign/{version}/start/file - the second of the two calls that flow makes up. The client downloaded every prepared file, signed the whole PDF locally with the private key on its own device, uploaded the results and names them here by hash.
The session is loaded, checked for expiry and confirmed to belong to the caller, and exactly one signed file has to arrive for every file handed out. Each upload is then verified rather than trusted: it has to be the prepared file with a signature appended to it and nothing else. Its opening bytes have to be the prepared file’s bytes unchanged, every signature the prepared file already carried has to still be there and to come back no worse than it left, and at least one new signature has to have appeared - fully intact, made with the certificate the signing was started with, and, when it is visible, landing inside the field it was started for. For icaQualified the new signature additionally has to meet the qualified certificate requirements. Only then do the uploads replace the document’s files, with the signature components stored and the document recorded as signed. Prepared files that carried only annotations or images are finalized here too, without the client sending anything for them.
When useTsa is set, a standalone document timestamp from the server named in tsaServer, or from the account’s default one, is appended as a new revision - only once an upload has passed the verification above, so the client’s signature and everything it covers stay untouched. An account configured to timestamp the signature only cannot be served by this variant: such a request is refused when it asks for a timestamp - the digest variant can serve it - and is otherwise finished without one.
Signing then carries the transaction forward: the signer stops being waited for, share tokens that are no longer needed are disabled, and when nobody else is expected to act the document is completed and sealed when the document owner’s settings seal on completion, with the owner’s seal-on-complete or default seal provider. An audit log entry is written, the signed and completed webhooks are sent, whoever has the turn next is notified, and the signature and its timestamps are counted against the subscription.
The session lives for a few minutes only, and the document must not change between the start and the finish - the signature was made over specific content, so a document that has moved on, or whose main file was replaced meanwhile, makes the upload unusable and the signing has to start again.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=' \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213",
"signedFiles": [
{
"originalFile": "40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun",
"signedFile": "2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco"
}
],
"tsaServer": "primary",
"useTsa": false
}
'import requests
url = "https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token="
payload = {
"sessionId": "sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213",
"signedFiles": [
{
"originalFile": "40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun",
"signedFile": "2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco"
}
],
"tsaServer": "primary",
"useTsa": False
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: 'sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213',
signedFiles: [
{
originalFile: '40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun',
signedFile: '2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco'
}
],
tsaServer: 'primary',
useTsa: false
})
};
fetch('https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=', 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/documents/sign/finish/file?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => 'sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213',
'signedFiles' => [
[
'originalFile' => '40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun',
'signedFile' => '2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco'
]
],
'tsaServer' => 'primary',
'useTsa' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token="
payload := strings.NewReader("{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
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/documents/sign/finish/file?token=")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/documents/sign/finish/file?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"sign:session:9f2c4e1b7a0d63855c1e8f04b2d97a63e5108c4fbd26a7391e0c58d4a6b7f213\",\n \"signedFiles\": [\n {\n \"originalFile\": \"40umqeox836wvkis95a41eiwz80k0s3puusl7vpk1houzqi4ecg09nosl3ee0sun\",\n \"signedFile\": \"2y57qfbsvgy6qgzwjrgy007p64b3xg7r4xzb5w07bopzgkck2vo1dgo457ywmlco\"\n }\n ],\n \"tsaServer\": \"primary\",\n \"useTsa\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 402,
"type": "SUBSCRIPTION:NOT_ACTIVE",
"message": "Subscription not active",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 410,
"type": "AUTH:IDENTITY_TOKEN_EXPIRED",
"message": "Identity token expired",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Body
Name of the Time Stamping Authority server to request the timestamp from, as configured in settings. When left out, the account's default server is used. Naming one requires the set_tsa right; leaving it out does not. Rejected when no timestamp is being requested.
200^[A-Za-z0-9._-]+$"primary"