Create Document from Template
POST/createdocument/:template_id
The Create Document API allows you to generate new documents by just providing template_id instead of uploading a new file(in the form of base64 or binary) every time you need to create a document. Templates for repeatedly used files can be created from user interface at Debug UI or using the Create Template API.
Request
Path Parameters
objectId of Template
- application/json
Body
required
Array [
]
signers
object[]
required
This parameter allows you to specify whether you want emails to be sent to signers. The default value is "true". If the value of this parameter is "true" and no 'email_subject'/'email_body' parameters are specified default email templates will be used.
Custom mail subject for signature request. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
Custom signature request email body. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
time to complete days is used to calculate expiry date of your document
Responses
- 200
- 400
- 405
In success response you will get url in response if you are also signer in document otherwise only get objectId, messsage
- application/json
- Schema
- Example (from schema)
Schema
{
"objectId": "hji2zxcv2P",
"url": "https://example.com",
"message": "Document sent successfully!"
}
If you haven't add widgets and signers in template or not provide signers along with their roles in body
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Please setup template properly!"
}
Invalid API Token!
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Invalid API token!"
}