Document
Overview
You can use use this API request to migrate document from external services to Legale.
Response will return the GUID
of document that is created from Legale.
This API request doesn't trigger any sign flow from legale, it just saves document and workflow info into db.
API detail
Request
- URL:
/migrate/document/
- Method:
POST
- Content-Type:
application/json
- Body:
{
"document": {
"subject": "Subject of document",
"file_name": "file name of document",
"description": "description of document",
"folder": "Contract/Company1",
"sign_status": 1,
"file": "JVBERioxLjUNCiW1tbWiDQoxIDAgb2JDo9PC....",
"document_type": "Test",
"note": "Test",
"date": null
},
"workflow": {
"flow_type": "priority",
"signers": [
{
"sign_method": "no_sms",
"sign_status": 2,
"id_validation": false,
"selfie_validation": false,
"video_validation": false,
"signer": "signer_email@legale.io",
"email": "signer_email@legale.io",
"firstname": "Signer firstname",
"lastname1": "Signer lastname1",
"lastname2": "Signer lastname2",
"started_at": "2024-12-12 05:00:00",
"signed_at": "2024-12-12 06:00:00",
}
]
}
}
Request body details
document
Value | Type | Is required | Description |
---|---|---|---|
subject | str | No | Subject of document |
file_name | str | Yes | The name of file you wanna to save as |
description | str | Yes | Description of document, maximum 1023 characters |
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. |
sign_status | int | No | Document sign status, default is 0 . Available values are 0 (Not signed), 1 (Signed), 2 (Rejected). |
file | str | Yes | Base64 string of document you wanna upload |
document_type | str | No | Document type that you can put any string you want save related to the document |
note | str | No | String data that you can put any string you want save related to the document |
date | str | No | Date string that you can put any date you want save related to the document |
workflow
If you want to migrate document as well as signing workflow, you can use this parameter. If you don't specify this parameter, workflow will not be saved.
Value | Type | Is required | Description |
---|---|---|---|
flow_type | str | No | Sign workflow type, available values are priority , simultaneously |
workflow | list | No | List of Workflow information of every signer. |
signers
Value | Type | Is required | Description |
---|---|---|---|
sign_method | str | Yes | Sign method you wanna to use to sign document, you can see more details from here. |
sign_status | int | No | Sign status of the signer in workflow. Default is 0 . Available values are 0 (Not signed), 1 (In sign process), 2 (Signed), 3 (Rejected). |
email | str | Yes | Signer email, this field is required. |
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 |
signer | str | No | This field should be set when you use sign_method - certification , local_certification , approve_legale . |
video_validation | bool | No | To require the video validation of signer in Remote and Remote SMS method |
selfie_validation | bool | No | To require the selfie validation of signer in Remote and Remote SMS |
id_validation | bool | No | To require the Identity Documentation validation of signer in Remote and Remote SMS |
x1 , y1 , x2 , y2 | float | No | Signature image position coordinate. (x1, y1) is the left bottom corner, (x2, y2) is the top right corner. Origin of coordinate is bottom left corner of document. Recommended ratio of width to height of signature image position is 3:1 |
pageno | int | No | Page number of document to insert the signature image in. The first page of document is 1 . |
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. |
started_at | datetime | No | The datetime of sign flow is started in UTC. |
signed_at | datetime | No | The datetime of sign flow is finished in UTC. |
Response
Success
- Status code:
201
- Body:
{
"GUID": "0fe75c65-70cc-4517-ac7f-ebba85bfa63e"
}
Error
- Status code:
400
- Body:
{
"code": "NO_SERVICE_NUMBER",
"message": "Service number is not enough",
}
Error code | Type | Description |
---|---|---|
NO_SERVICE_NUMBER | str | You run out your storage in legale service, to continue, you should buy it in legale store. |