Skip to main content

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.
ValueTypeIs requiredDescription
folderstrNoFolder path that you wanna to save document in.
If folder structure is not matched to current existing structure, system will create it.
file_namestrNoCustom file name of the document.
  • signers
ValueTypeIs requiredDescription
sign_methodstrYesSign method you wanna to use to sign document
emailstrYesSigner email
phonestrNoSigner phone to use receive OTP. This parameter is needed when you set sign_method as sms
firstnamestrNoSigner first name
lastname1strNoSigner first last name
lastname2strNoSigner second last name
anchorstrNoThe 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_idstrNoTablet or mobile device ID that you can get from this request. This parameter is needed when you set sign_method as tablet_sign
is_fingerprintboolNoTo require fingerprint when you sign document on mobile device. This parameter is needed when you set sign_method as tablet_sign
is_NIDboolNoTo 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 strNoSign 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 valueDescription
no_smsSign document using Remote, in this case, signer will receive the sign request through his email. No need to pass the phone number
smsSign 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
certificationSign 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_certificateSign 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.
approveThis 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_legaleThis 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_signThis 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 codeTypeDescription
INVALID_DOCUMENT_STATUSstrDocument is already in another status, you can start sign flow with only document of sign_status 0.