Create
Overview
You can send document to Legaliza using this API request.
API detail
Request
- URL:
/documents/
- Method:
POST
- Content-Type:
application/json
- Body:
{
"document_type": 1,
"file": "JVBERi0xLjQNJeLjz9MNCjE1IDAgb2J...",
"file_name": "contract.pdf",
"description": "Contract for notary",
"attached_files": [
{
"type": 1,
"file": "JVBERi0xLjQNJeLjz9MNCjE1IDAgb2J...",
"file_name": "id_card.jpg",
}
],
"signers": [
{
"latitude": 100,
"longitude": 100
},
{
"latitude": 101,
"longitude": 101
}
],
"assign_callback": {
"callback_url": "https://your.callback.com/assign/",
"callback_header": {
"Api-Key": "your service api key"
}
}
}
Request body details
Value | Type | Is required | Description |
---|---|---|---|
document_type | int | Yes | The ID of document type of one of document types that you got from here. |
file | str | Yes | Base64 string of the PDF file that you are going to upload to Legaliza. |
file_name | str | Yes | File name of the PDF file, file name should be in valid file name format, for example contract.pdf , otherwise, Legaliza will raise validation error. |
description | str | No | Description of the PDF file. |
attached_files
Value | Type | Is required | Description |
---|---|---|---|
type | int | Yes | The ID of attached file type of the document type that you selected above. |
file | str | Yes | Base64 string of the attached file |
file_name | str | Yes | File name of the attached file, file name should be in valid file name format for PDF, for example contract.pdf , otherwise, Legaliza will raise validation error. |
signers
Value | Type | Is required | Description |
---|---|---|---|
latitude | float | Yes | Latitude of signer geolocation info |
longitude | float | Yes | Longitude of signer geolocation info |
assign_callback
Value | Type | Is required | Description |
---|---|---|---|
callback_url | str | Yes | Callback URL to receive an event when document is assigned to a notary user. You can see more details about the callback request from here. |
callback_header | json | No | Extra API request header that you need to get from callback request, for example, API key for authentication. |
Response
Success
- Status code:
201
- Body:
{
"id": "bae92562-effb-4db7-a8f8-aabb37674597",
"attached_files": [
{
"id": 1,
"file": "http://dev.api.legaliza.io/media/documents/bae92562-effb-4db7-a8f8-aabb37674597/attached_files/attached1.jpg",
"file_name": "id_card.jpg",
"description": null,
"extra_data": null,
"type": 1
},
],
"file": "http://dev.api.legaliza.io/media/documents/bae92562-effb-4db7-a8f8-aabb37674597/documents/test.pdf",
"file_name": "contract.pdf",
"description": "Contract for notary",
"status": "not_signed",
"customer": "6a579a31-0d99-4ab6-bd4e-eb5436b587a6",
"document_type": 1
}
status
Value | Type | Description |
---|---|---|
not_signed | str | Document is not signed |
signed | str | Document is signed |
Error
All the errors are in Spanish, are following general Rest API response error format.
- Status code:
400
- Body:
{
"document_type": [
"Este campo es requerido."
]
}