Import batch of documents by excel file
Updated date: 30/04/2023
Updated by: VNPT eContract's team
Purpose
Performing batch creation of documents using a pre-existing document template through importing an excel file.
- Request URL:
/api/batch-imports/create
- HTTP method:
POST
- HTTP content-type:
multipart/form-data
- Authorize:
Bearer token
- Parameter:
Key | Type | Description |
---|---|---|
file | file | [Required] Excel file |
name | string | [Required] Name of batch |
departmentId | int | [Required] Id of department |
documentTypeId | int | [Required] Id of document type |
documentTemplateId | int | [Required] Id of document template |
Sample response body
{
"data": {
"id": 1234,
"createdDate": "2022-12-13T10:21:51.712847+07:00",
"uploadedByUserId": 2341,
"numberOfRecords": 3,
"name": "Test batch import via API",
"documents": [
{
"id": "e429b738-f30c-44e6-f25b-08dadcb92ffb",
"createdDate": "2022-12-13T10:21:54.618228+07:00",
"lastModifiedDate": "2022-12-13T10:21:54.6181865+07:00",
"expiryDate": "2022-12-15T00:00:00",
"no": "WV38",
"subject": "Labor_01",
"hasVerified": false,
"fileType": 0,
"status": {
"value": 1,
"description": "New document"
},
"description": "Labor contract 01",
"department": {
"id": 33,
"name": "VNPT eContract",
"code": "DHB",
"users": []
},
"createdByUserId": 2341,
"processRecipientCount": 3,
"processInOrder": true,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isCancelable": false,
"isEditable": true,
"isShareable": false,
"isAccessable": false,
"isExpired": false,
"canDownload": false,
"type": {
"id": 47,
"code": "IRP",
"name": "Internal report",
"description": "Internal report for Dev office",
"documentCount": 3
},
"documentTemplate": {
"id": 130,
"name": "Indefinite contract template",
"createdDate": "2022-10-31T13:43:38.9327148",
"fileName": "Mau_hop_hong.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl": "{HOST}/Api/Download?token=",
"isShareable": false,
"isDeletelable": false,
"isUpdateable": false
},
"processes": [
{
"id": "39e86913-d55a-4bd8-d61f-08dadcb93017",
"createdDate": "2022-12-13T10:21:54.6172923+07:00",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 2328,
"documentId": "e429b738-f30c-44e6-f25b-08dadcb92ffb"
}
],
"file": {
"name": "Import_lo_1.pdf",
"size": 164711
},
"downloadUrl": "{HOST}/Api/Download?token=..."
}
],
"isSendable": true,
"isCancelable": true
},
"success": true,
"code": 0,
"messages": [
"Import batch document success"
]
}