Skip to main content
Version: 2.3.0

Get a document template

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


Purpose​

The function retrieves document template information using the template Id.

  • Request URL: /api/document-templates/{id}
  • HTTP method: GET
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
idint[Required] Id of document template

Sample request​

Id of document template: id = 1149
Request: /api/document-templates/1149

Sample response body​

{
"data": {
"id": 1149,
"name": "Batch import sample template",
"createdDate": "2022-11-22T14:18:25.3990136",
"fillableFields": [
{
"key": "{{ngay}}",
"name": "ngay",
"description": "Ngày"
},
{
"key": "{{thang}}",
"name": "thang"
},
{
"key": "{{nam}}",
"name": "nam"
},
{
"key": "{{so_hd}}",
"name": "so_hd"
},
{
"key": "{{nld_hoten}}",
"name": "nld_hoten",
"description": "Họ và tên NLD"
},
{
"key": "{{nld_namsinh}}",
"name": "nld_namsinh"
},
{
"key": "{{nld_diachi}}",
"name": "nld_diachi"
},
{
"key": "{{nld_cccd}}",
"name": "nld_cccd"
},
{
"key": "{{muc_luong}}",
"name": "muc_luong"
}
],
"fileName": "dochub-template.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl": "{HOST}/Api/Download?token=...",
"isDisabled": false,
"isLaborContractTemplate": false
},
"success": true,
"code": 0,
"messages": []
}

Response Body Description​

KeyTypeDescription
successbooleanResponse status (true: Success, false: Failure)
codeintResponse code from the system
messagesarrayList of messages or errors returned by the system
dataobjectObject containing detailed information about the document template (see details below)

Details of data:​

KeyTypeDescription
idintDocument template ID
namestringDocument template name
fillableFieldsarrayList of dynamic data fields that can be filled in (Array[object]) (see details below)
createdDatestringDocument template creation time (ISO 8601 format)
fileNamestringDocument template file name
downloadUrlstringURL to download the original file
pdfDownloadUrlstringURL to download the file in PDF format
isDisabledbooleanTemplate status (true: Disabled, false: Active)
isLaborContractTemplatebooleanWhether this is a labor contract template (true: Yes, false: No)

Details of fillableFields:​

The list contains the dynamic data fields in the document template, with the following properties for each element:

KeyTypeDescription
keystringIdentifier key of the data field in the template (e.g., {{ngay}}, {{so_hd}})
namestringData field name
descriptionstringDetailed description of the meaning of the data field