import { FirmaClient } from "@firma-dev/sdk";
const firma = new FirmaClient({ apiKey: "YOUR_API_KEY" });
const response = await firma.signingRequests.updateSigningRequest({
id: "id",
signing_request_properties: {
name: "Updated Contract Name",
expiration_hours: 72
},
recipients: [{
id: "rec1-e89b-12d3-a456-426614174000",
first_name: "John",
last_name: "Smith",
email: "john.smith@example.com",
designation: "Signer",
order: 1
}, {
first_name: "Jane",
last_name: "Doe",
email: "jane@example.com",
designation: "Signer",
order: 2
}],
deleted_recipients: [{
recipient_id: "rec2-e89b-12d3-a456-426614174000",
field_action: "reassign",
reassign_to_recipient_id: "rec1-e89b-12d3-a456-426614174000"
}],
fields: [{
id: "field1-e89b-12d3-a456-426614174000",
type: "signature",
position: {
x: 15,
y: 85,
width: 30,
height: 10
},
page_number: 1,
required: true,
recipient_id: "rec1-e89b-12d3-a456-426614174000"
}],
reminders: [{
hours: 48,
all_users: true,
subject: "Reminder: Please sign the document",
message: "This is a reminder to complete your signature."
}]
});
console.log(response);curl --request PUT \
--url https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"signing_request_properties": {
"name": "Updated Contract Name",
"expiration_hours": 72
},
"recipients": [
{
"id": "rec1-e89b-12d3-a456-426614174000",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"designation": "Signer",
"order": 1
},
{
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"designation": "Signer",
"order": 2
}
],
"deleted_recipients": [
{
"recipient_id": "rec2-e89b-12d3-a456-426614174000",
"field_action": "reassign",
"reassign_to_recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"fields": [
{
"id": "field1-e89b-12d3-a456-426614174000",
"type": "signature",
"position": {
"x": 15,
"y": 85,
"width": 30,
"height": 10
},
"page_number": 1,
"required": true,
"recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"reminders": [
{
"hours": 48,
"all_users": true,
"subject": "Reminder: Please sign the document",
"message": "This is a reminder to complete your signature."
}
]
}
'import requests
url = "https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}"
payload = {
"signing_request_properties": {
"name": "Updated Contract Name",
"expiration_hours": 72
},
"recipients": [
{
"id": "rec1-e89b-12d3-a456-426614174000",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"designation": "Signer",
"order": 1
},
{
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"designation": "Signer",
"order": 2
}
],
"deleted_recipients": [
{
"recipient_id": "rec2-e89b-12d3-a456-426614174000",
"field_action": "reassign",
"reassign_to_recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"fields": [
{
"id": "field1-e89b-12d3-a456-426614174000",
"type": "signature",
"position": {
"x": 15,
"y": 85,
"width": 30,
"height": 10
},
"page_number": 1,
"required": True,
"recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"reminders": [
{
"hours": 48,
"all_users": True,
"subject": "Reminder: Please sign the document",
"message": "This is a reminder to complete your signature."
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signing_request_properties: {name: 'Updated Contract Name', expiration_hours: 72},
recipients: [
{
id: 'rec1-e89b-12d3-a456-426614174000',
first_name: 'John',
last_name: 'Smith',
email: 'john.smith@example.com',
designation: 'Signer',
order: 1
},
{
first_name: 'Jane',
last_name: 'Doe',
email: 'jane@example.com',
designation: 'Signer',
order: 2
}
],
deleted_recipients: [
{
recipient_id: 'rec2-e89b-12d3-a456-426614174000',
field_action: 'reassign',
reassign_to_recipient_id: 'rec1-e89b-12d3-a456-426614174000'
}
],
fields: [
{
id: 'field1-e89b-12d3-a456-426614174000',
type: 'signature',
position: {x: 15, y: 85, width: 30, height: 10},
page_number: 1,
required: true,
recipient_id: 'rec1-e89b-12d3-a456-426614174000'
}
],
reminders: [
{
hours: 48,
all_users: true,
subject: 'Reminder: Please sign the document',
message: 'This is a reminder to complete your signature.'
}
]
})
};
fetch('https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}', 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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}",
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([
'signing_request_properties' => [
'name' => 'Updated Contract Name',
'expiration_hours' => 72
],
'recipients' => [
[
'id' => 'rec1-e89b-12d3-a456-426614174000',
'first_name' => 'John',
'last_name' => 'Smith',
'email' => 'john.smith@example.com',
'designation' => 'Signer',
'order' => 1
],
[
'first_name' => 'Jane',
'last_name' => 'Doe',
'email' => 'jane@example.com',
'designation' => 'Signer',
'order' => 2
]
],
'deleted_recipients' => [
[
'recipient_id' => 'rec2-e89b-12d3-a456-426614174000',
'field_action' => 'reassign',
'reassign_to_recipient_id' => 'rec1-e89b-12d3-a456-426614174000'
]
],
'fields' => [
[
'id' => 'field1-e89b-12d3-a456-426614174000',
'type' => 'signature',
'position' => [
'x' => 15,
'y' => 85,
'width' => 30,
'height' => 10
],
'page_number' => 1,
'required' => true,
'recipient_id' => 'rec1-e89b-12d3-a456-426614174000'
]
],
'reminders' => [
[
'hours' => 48,
'all_users' => true,
'subject' => 'Reminder: Please sign the document',
'message' => 'This is a reminder to complete your signature.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}"
payload := strings.NewReader("{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"signing_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"document_url": "<string>",
"document_url_expires_at": "2023-11-07T05:31:56Z",
"document_page_count": 123,
"status": "<string>",
"expiration_hours": 123,
"settings": {
"allow_download": true,
"attach_pdf_on_finish": true,
"hand_drawn_only": true
},
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"created_date": "2023-11-07T05:31:56Z",
"sent_date": "2023-11-07T05:31:56Z",
"finished_date": "2023-11-07T05:31:56Z",
"cancelled_date": "2023-11-07T05:31:56Z"
},
"recipients": [
{
"first_name": "<string>",
"email": "jsmith@example.com",
"designation": "Signer",
"id": "<string>",
"_temp_id": "<string>",
"template_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_name": "<string>",
"order": 2,
"phone_number": "<string>",
"street_address": "<string>",
"city": "<string>",
"state_province": "<string>",
"postal_code": "<string>",
"country": "<string>",
"title": "<string>",
"company": "<string>",
"custom_fields": {}
}
],
"reminders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hours": 2,
"subject": "<string>",
"message": "<string>",
"all_users": true,
"template_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sent_on": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"summary": {
"properties_updated": true,
"recipients_created": 123,
"recipients_updated": 123,
"recipients_deleted": 123,
"fields_created": 123,
"fields_updated": 123,
"fields_reassigned": 123,
"fields_deleted": 123,
"reminders_created": 123,
"reminders_updated": 123,
"warnings": [
"<string>"
]
}
}{
"error": "Validation failed",
"message": "Multiple validation errors occurred",
"details": {
"recipients": [
"Recipient 1: email is invalid"
],
"deleted_recipients": [
"Cannot reassign: designations must match"
],
"fields": [
"Field 2: x coordinate must be between 0 and 100"
]
}
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "Not Found",
"message": "The requested resource was not found"
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Rate Limit Exceeded",
"message": "Too many requests. Please wait before retrying.",
"details": {
"retry_after": 45
}
}Mise à jour complète de la demande de signature
Effectue des mises à jour complètes d’une demande de signature, y compris les propriétés, les destinataires, les champs et les rappels. Impossible de mettre à jour après que la demande de signature a été envoyée, complétée ou annulée. Toutes les sections sont optionnelles, mais au moins une doit être fournie.
Modèle d’ID temporaire pour les nouveaux destinataires : lors de l’ajout de nouveaux destinataires dans une mise à jour complète, utilisez le champ ‘temp_id’ (format : ‘temp_X’) au lieu de ‘id’ pour établir des relations avec les champs et les rappels. Cela permet de créer de nouveaux destinataires et de les référencer dans les champs/rappels en une seule requête. Utilisez le champ ‘id’ pour mettre à jour des destinataires existants. Règles de validation : (1) les ID temporaires doivent commencer par ‘temp’ ; (2) chaque ID temporaire doit être unique au sein de la requête ; (3) les champs et rappels peuvent référencer des ID temporaires dans leur propriété recipient_id ; (4) l’API résout automatiquement les ID temporaires en véritables UUID après la création du destinataire.
import { FirmaClient } from "@firma-dev/sdk";
const firma = new FirmaClient({ apiKey: "YOUR_API_KEY" });
const response = await firma.signingRequests.updateSigningRequest({
id: "id",
signing_request_properties: {
name: "Updated Contract Name",
expiration_hours: 72
},
recipients: [{
id: "rec1-e89b-12d3-a456-426614174000",
first_name: "John",
last_name: "Smith",
email: "john.smith@example.com",
designation: "Signer",
order: 1
}, {
first_name: "Jane",
last_name: "Doe",
email: "jane@example.com",
designation: "Signer",
order: 2
}],
deleted_recipients: [{
recipient_id: "rec2-e89b-12d3-a456-426614174000",
field_action: "reassign",
reassign_to_recipient_id: "rec1-e89b-12d3-a456-426614174000"
}],
fields: [{
id: "field1-e89b-12d3-a456-426614174000",
type: "signature",
position: {
x: 15,
y: 85,
width: 30,
height: 10
},
page_number: 1,
required: true,
recipient_id: "rec1-e89b-12d3-a456-426614174000"
}],
reminders: [{
hours: 48,
all_users: true,
subject: "Reminder: Please sign the document",
message: "This is a reminder to complete your signature."
}]
});
console.log(response);curl --request PUT \
--url https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"signing_request_properties": {
"name": "Updated Contract Name",
"expiration_hours": 72
},
"recipients": [
{
"id": "rec1-e89b-12d3-a456-426614174000",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"designation": "Signer",
"order": 1
},
{
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"designation": "Signer",
"order": 2
}
],
"deleted_recipients": [
{
"recipient_id": "rec2-e89b-12d3-a456-426614174000",
"field_action": "reassign",
"reassign_to_recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"fields": [
{
"id": "field1-e89b-12d3-a456-426614174000",
"type": "signature",
"position": {
"x": 15,
"y": 85,
"width": 30,
"height": 10
},
"page_number": 1,
"required": true,
"recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"reminders": [
{
"hours": 48,
"all_users": true,
"subject": "Reminder: Please sign the document",
"message": "This is a reminder to complete your signature."
}
]
}
'import requests
url = "https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}"
payload = {
"signing_request_properties": {
"name": "Updated Contract Name",
"expiration_hours": 72
},
"recipients": [
{
"id": "rec1-e89b-12d3-a456-426614174000",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"designation": "Signer",
"order": 1
},
{
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"designation": "Signer",
"order": 2
}
],
"deleted_recipients": [
{
"recipient_id": "rec2-e89b-12d3-a456-426614174000",
"field_action": "reassign",
"reassign_to_recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"fields": [
{
"id": "field1-e89b-12d3-a456-426614174000",
"type": "signature",
"position": {
"x": 15,
"y": 85,
"width": 30,
"height": 10
},
"page_number": 1,
"required": True,
"recipient_id": "rec1-e89b-12d3-a456-426614174000"
}
],
"reminders": [
{
"hours": 48,
"all_users": True,
"subject": "Reminder: Please sign the document",
"message": "This is a reminder to complete your signature."
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signing_request_properties: {name: 'Updated Contract Name', expiration_hours: 72},
recipients: [
{
id: 'rec1-e89b-12d3-a456-426614174000',
first_name: 'John',
last_name: 'Smith',
email: 'john.smith@example.com',
designation: 'Signer',
order: 1
},
{
first_name: 'Jane',
last_name: 'Doe',
email: 'jane@example.com',
designation: 'Signer',
order: 2
}
],
deleted_recipients: [
{
recipient_id: 'rec2-e89b-12d3-a456-426614174000',
field_action: 'reassign',
reassign_to_recipient_id: 'rec1-e89b-12d3-a456-426614174000'
}
],
fields: [
{
id: 'field1-e89b-12d3-a456-426614174000',
type: 'signature',
position: {x: 15, y: 85, width: 30, height: 10},
page_number: 1,
required: true,
recipient_id: 'rec1-e89b-12d3-a456-426614174000'
}
],
reminders: [
{
hours: 48,
all_users: true,
subject: 'Reminder: Please sign the document',
message: 'This is a reminder to complete your signature.'
}
]
})
};
fetch('https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}', 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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}",
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([
'signing_request_properties' => [
'name' => 'Updated Contract Name',
'expiration_hours' => 72
],
'recipients' => [
[
'id' => 'rec1-e89b-12d3-a456-426614174000',
'first_name' => 'John',
'last_name' => 'Smith',
'email' => 'john.smith@example.com',
'designation' => 'Signer',
'order' => 1
],
[
'first_name' => 'Jane',
'last_name' => 'Doe',
'email' => 'jane@example.com',
'designation' => 'Signer',
'order' => 2
]
],
'deleted_recipients' => [
[
'recipient_id' => 'rec2-e89b-12d3-a456-426614174000',
'field_action' => 'reassign',
'reassign_to_recipient_id' => 'rec1-e89b-12d3-a456-426614174000'
]
],
'fields' => [
[
'id' => 'field1-e89b-12d3-a456-426614174000',
'type' => 'signature',
'position' => [
'x' => 15,
'y' => 85,
'width' => 30,
'height' => 10
],
'page_number' => 1,
'required' => true,
'recipient_id' => 'rec1-e89b-12d3-a456-426614174000'
]
],
'reminders' => [
[
'hours' => 48,
'all_users' => true,
'subject' => 'Reminder: Please sign the document',
'message' => 'This is a reminder to complete your signature.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}"
payload := strings.NewReader("{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signing_request_properties\": {\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n },\n \"recipients\": [\n {\n \"id\": \"rec1-e89b-12d3-a456-426614174000\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"designation\": \"Signer\",\n \"order\": 1\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"email\": \"jane@example.com\",\n \"designation\": \"Signer\",\n \"order\": 2\n }\n ],\n \"deleted_recipients\": [\n {\n \"recipient_id\": \"rec2-e89b-12d3-a456-426614174000\",\n \"field_action\": \"reassign\",\n \"reassign_to_recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"fields\": [\n {\n \"id\": \"field1-e89b-12d3-a456-426614174000\",\n \"type\": \"signature\",\n \"position\": {\n \"x\": 15,\n \"y\": 85,\n \"width\": 30,\n \"height\": 10\n },\n \"page_number\": 1,\n \"required\": true,\n \"recipient_id\": \"rec1-e89b-12d3-a456-426614174000\"\n }\n ],\n \"reminders\": [\n {\n \"hours\": 48,\n \"all_users\": true,\n \"subject\": \"Reminder: Please sign the document\",\n \"message\": \"This is a reminder to complete your signature.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"signing_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"document_url": "<string>",
"document_url_expires_at": "2023-11-07T05:31:56Z",
"document_page_count": 123,
"status": "<string>",
"expiration_hours": 123,
"settings": {
"allow_download": true,
"attach_pdf_on_finish": true,
"hand_drawn_only": true
},
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"created_date": "2023-11-07T05:31:56Z",
"sent_date": "2023-11-07T05:31:56Z",
"finished_date": "2023-11-07T05:31:56Z",
"cancelled_date": "2023-11-07T05:31:56Z"
},
"recipients": [
{
"first_name": "<string>",
"email": "jsmith@example.com",
"designation": "Signer",
"id": "<string>",
"_temp_id": "<string>",
"template_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_name": "<string>",
"order": 2,
"phone_number": "<string>",
"street_address": "<string>",
"city": "<string>",
"state_province": "<string>",
"postal_code": "<string>",
"country": "<string>",
"title": "<string>",
"company": "<string>",
"custom_fields": {}
}
],
"reminders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hours": 2,
"subject": "<string>",
"message": "<string>",
"all_users": true,
"template_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sent_on": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"summary": {
"properties_updated": true,
"recipients_created": 123,
"recipients_updated": 123,
"recipients_deleted": 123,
"fields_created": 123,
"fields_updated": 123,
"fields_reassigned": 123,
"fields_deleted": 123,
"reminders_created": 123,
"reminders_updated": 123,
"warnings": [
"<string>"
]
}
}{
"error": "Validation failed",
"message": "Multiple validation errors occurred",
"details": {
"recipients": [
"Recipient 1: email is invalid"
],
"deleted_recipients": [
"Cannot reassign: designations must match"
],
"fields": [
"Field 2: x coordinate must be between 0 and 100"
]
}
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "Not Found",
"message": "The requested resource was not found"
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Rate Limit Exceeded",
"message": "Too many requests. Please wait before retrying.",
"details": {
"retry_after": 45
}
}Autorisations
Corps
Upsert des destinataires - incluez 'id' pour mettre à jour des destinataires existants, utilisez '_temp_id' (par ex. 'temp_1') pour les nouveaux destinataires afin de les référencer dans les champs et rappels au sein de la même requête. Un destinataire existant ne peut pas passer de CC à Signataire/Approbateur, ni inversement (400) ; supprimez-le et recréez-le.
Show child attributes
Show child attributes
Lors de la suppression de destinataires dont les champs sont référencés par des conditions dans d'autres champs : si true, retire automatiquement les références de condition ; si false (par défaut), la requête sera rejetée avec une erreur listant les champs dépendants.
Langue facultative des e-mails pour cette demande de signature. Lorsqu'elle est définie, tous les e-mails destinés au signataire (et le format de date) l'utilisent. Omettez-la ou utilisez null pour revenir à la langue par défaut de l'espace de travail, puis de l'entreprise (comportement inchangé).
en, es, it, pt, fr, de, el, ru, pl, cs, sv, nl, ro, nb, ca Le documents_layout_version de votre dernière lecture (multi-documents). Obligatoire pour écrire un champ sur une demande de signature comportant plus d'un document ou une version de mise en page supérieure à 1 (409 DOCUMENTS_LAYOUT_VERSION_REQUIRED) ; une valeur obsolète répond 409 DOCUMENT_SET_VERSION_CONFLICT ; une valeur qui n'est pas un entier positif ou nul répond 400 VALIDATION_ERROR avec la clé documents_layout_version.
x >= 0Réponse
Demande de signature mise à jour avec succès. Renvoie la demande de signature mise à jour et un résumé des modifications effectuées.
Résultat de la mise à jour de la demande de signature
Cette page vous a-t-elle été utile ?