Start sign flow
Overview
You can start sign flow from smart template using this API.
You should specify variables to convert template to document and signers to start sign flow.
After you start sign flow successfully, you can use this API to get sign status.
API detail
Request
- URL:
/template/{{template_id}}
- Method:
POST
- Content-Type:
application/json
- Body:
{
"data": [
{
"variables": {
"1": "Value1",
"2": "Value2",
"folder": "Contract/Company1",
"file_name": "Contract1",
},
"signers": [
{
"email": "signer1.legale.io",
"sign_method": "no_sms",
"phone": null,
"firstname": "Test",
"lastname1": "Test",
"lastname2": "Test",
"video_validation": false,
"selfie_validation": false,
"id_validation": false,
"anchor": "Test",
"device_id": null,
"is_fingerprint": true,
"is_NID": true,
"sign_status_callback_url": "https://your.service.com/status_callback"
}
],
"shared_list": [
{
"email": "shared.person@gmail.com",
},
],
"callback_url": "https://your.service.com/callback",
"callback_key": "your_callback_key",
},
]
}
variables
variable is JSON object.key
should be variable number of variable of template. If you no specify variables, it will use blank string.
Value | Type | Is required | Description |
---|---|---|---|
folder | str | No | Folder path that you wanna to save document in. |
If folder structure is not matched to current existing structure, system will create it. | |||
file_name | str | No | Custom file name of the document. |
signers
Value | Type | Is required | Description |
---|---|---|---|
sign_method | str | Yes | Sign method you wanna to use to sign document |
email | str | Yes | Signer email |
phone | str | No | Signer phone to use receive OTP. This parameter is needed when you set sign_method as sms |
firstname | str | No | Signer first name |
lastname1 | str | No | Signer first last name |
lastname2 | str | No | Signer second last name |
anchor | str | No | The specific word in your document which you want to put the signature image on. The start point of anchor text will be the top left corner of the signature image. The sign image size will be 180 * 60 px rectangle by default. |
device_id | str | No | Tablet or mobile device ID that you can get from this request. This parameter is needed when you set sign_method as tablet_sign |
is_fingerprint | bool | No | To require fingerprint when you sign document on mobile device. This parameter is needed when you set sign_method as tablet_sign |
is_NID | bool | No | To require national ID image when you sign document on mobile device. This parameter is needed when you set sign_method as tablet_sign |
sign_status_callback_url | str | No | Sign callback URL of your service to get back the callback request of every sign status, system will send to this url the sign status |
sign_method
Available value | Description |
---|---|
no_sms | Sign document using Remote, in this case, signer will receive the sign request through his email. No need to pass the phone number |
sms | Sign document using Remote with SMS verification, in this case, signer will receive the sign request through his email. phone is required to use this method |
certification | Sign document using cloud certificate, in this case, signer can be you or other legale person. Signer will receive sign request in his legale account |
local_certificate | Sign document using local certificate, in this case, signer can be you or other legale person. Signer will receive sign request in his legale account. Signer should have his local certificate. This method is working on only Windows 10 for now. |
approve | This is not digital sign. This method will send document to approver to approve current flow by himself. email is not legale user in this case. |
approve_legale | This is not digital sign. This method will send document to approver to approve current flow by himself. email should be legale user in this case. |
tablet_sign | This is sign method to document to sign in mobile device. device_id is required to use this method |
shared_list
Email list that you wanna share signed document with.
Response
Success
- Status code:
200
- Body:
{
"data": [
"https://app.legale.io/api/remote/3470cf1d-dddd-4b59-a22f-445aaef913d2/0",
null,
//...
],
"code": null,
"message": ""
}
Error
- Status code:
400
- Body:
{
"code": "INVALID_DOCUMENT_STATUS",
"message": "Document is already in sign flow",
}
Error code | Type | Description |
---|---|---|
INVALID_DOCUMENT_STATUS | str | Document is already in another status, you can start sign flow with only document of sign_status 0. |