How do I compose and send for signature in one call?
Without code (1.4): in the console, Flows, Sign a Word document takes a .docx you already filled in, the signers, the order, the watchers, the expiry and the reminders; Validate shows the checks and the cost, Send runs this same flow. A {{ signature.A }} tag in the Word file places a signature; without tags each signer signs at the end of the last page.
Use /api/v1/flow instead of /api/v1/compose/documents/generate
whenever the document is going out for signature the moment it exists — one
request, one round trip, and no window where you are holding a document that
has not been sent yet:
curl -X POST https://your-host/api/v1/flow \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-4471" \
-d '{
"data": { "customer": { "name": "Acme Srl" } },
"settings": { "templateId": "contract-standard-8bc99b" },
"signature": {
"subject": "Service agreement",
"signers": {
"A": { "email": "anna@acme.example", "fullName": "Anna Rossi",
"fields": [{ "kind": "signature", "page": 1,
"x": 0.1, "y": 0.78, "width": 0.32, "height": 0.09 }] }
}
}
}'
Where the signature goes. The usual way is a tag in the
template, {{ signature.A }}, written like any other field:
signer A then needs no fields and signs where the tag
is. The alternative is fields, as here: x and
y are fractions of the page from the top-left corner (0.1 = a tenth
of the way across). How to read them off a PDF, and everything else about
placing a signature: Where the signature goes on
the page.
The signers' language. The mails and the signing pages use each signer's language
("language": "it" or "en" on the signer), else the signature's
(signature.language), else your organisation's.
Always send the Idempotency-Key — this call charges twice and
emails a real person, and a retried request without one does both again.
Full field list and what comes back:
Compose and sign, in one call.