Skip to main content
Version: 2.3.0

Import advanced batch of documents

Updated date: 18/08/2026
Updated by: VNPT eContract's team


Purpose​

Perform bulk creation of documents using a pre-prepared document template, refer to Document Template Management
Or download the sample document template here.

  • Request URL: /api/batch-imports/create-advanced
  • HTTP method: POST
  • HTTP content-type: application/json
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
namestring[Required] Name of batch
departmentIdint[Required] Id of department
documentTypeIdint[Required] Id of document type
documentTemplateIdint[Required] Id of document template
parametersList<string>[Required] Parameters
rowsList<List<string>>[Required] Data list
tip

accessPermissionCode is access permissions:

  • V is view only
  • D is digital sign
  • E is e-sign
  • EKYC is eKYC sign
  • DR is sign draw
  • A is approve
  • F is fill data
  • C is coordinate
caution
  • F allways placed before D, E, EKYC and DR in sequential processing
  • Refer to the variable {{#items}} if you want to pass data in an array format
  • Use the \n character to insert a line break (see the example in the variable {{nhiem_vu_cong_viec}})
  • The default length of variables is 2000 characters.

Sample request​

{
"name": "[DEMO] Batch import 02/2023",
"departmentId": 1,
"documentTypeId": 1,
"documentTemplateId": 2,
"parameters": [
"{{D.FileName}}",
"{{D.No}}",
"{{D.Subject}}",
"{{D.ExpiryDate}}",
"{{D.Description}}",
"{{D.IsOrder}}",
"{{P.Code}}",
"{{P.AccessPermission}}",
"{{P.Code}}",
"{{P.AccessPermission}}",
"{{day}}",
"{{month}}",
"{{year}}",
"{{ben_a}}",
"{{ben_b}}",
"{{nhiem_vu_cong_viec}}",
"{{dien_tich_dat}}",
"{{dien_tich_nha}}",
"{{#items}}"
],
"rows": [
[
"fileNameHdtn01",
"HDTN01",
"House Rental Contract with Mr. Nguyễn Văn A",
"",
"Contract description",
"Y",
"baoth",
"DR",
"nguyenvana",
"D",
"17",
"02",
"2022",
"Tô Hoài Bảo",
"Nguyễn Văn A",
"- Comply with regulations on the use of equipment, machinery, and supplies by employees.\n- Adhere to regulations on dress code, behavior, and working attitude of employees.\n- Follow regulations on occupational safety and hygiene in the workplace.",
"150m2",
"450m2",
"[ {\"no\": \"1\",\"name\": \"Quy trinh\",\"creator\": \"Ngo Thuy Trinh\",\"year\": \"2025\"}, {\"no\": \"2\",\"name\": \"Quy dinh\",\"creator\": \"Thuy Trinh\",\"year\": \"2020\"} ]"
],
[
"fileNameHdtn02",
"HDTN02",
"House Rental Contract with Mr. Trần Thùy Trinh",
"",
"Contract description",
"Y",
"baoth",
"DR",
"tranthuytrinh",
"D",
"20",
"02",
"2022",
"Tô Hoài Bảo",
"Trần Thùy Trinh",
"- Comply with regulations on protecting business secrets and technological confidentiality of the company.\n- Adhere to regulations on occupational safety and hygiene in the workplace.",
"200m2",
"180m2",
"[ {\"no\": \"1\",\"name\": \"Quy trinh phong A\",\"creator\": \"Ngo Thuy Trinh\",\"year\": \"04.2025\"}, {\"no\": \"2\",\"name\": \"Quy dinh\",\"creator\": \"Thuy Trinh\",\"year\": \"2020\"} ]"
]
]
}

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,
"hasSeal": false,
"requireVerifiedUserSigning": false,
"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,
"isWaitToFillData": false,
"isWaitToCoordinate": false,
"isWaitToESign": false,
"isWaitToEkyc": false,
"isFillable": 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=",
"isDisabled": false,
"isLaborContractTemplate": true,
"childrenTemplates": []
},
"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=...",
"fixedPosition": false,
"isLaborContractDocument": false
}
],
},
"success": true,
"code": 0,
"messages": [
"Import batch document success"
]
}

Response Parameters​

KeyTypeDescription
dataobjectObject containing detailed information about the newly created batch (see below)
successbooleanRequest processing status (true: Success, false: Failed)
codeintResponse status code from the system
messagesArray[string]List of messages returned by the system

Details of the data object:​

KeyTypeDescription
idintID of the import batch
createdDatestringBatch creation time (ISO 8601 format)
uploadedByUserIdintID of the user who performed the upload
numberOfRecordsintTotal number of documents created in the batch
namestringName of the batch
documentsArray[object]List of documents created in the batch (see document details)