Get list of document templates
Updated date: 18/08/2026
Updated by: VNPT eContract's team
Purpose
The function retrieves information about a list of document templates that the user has created or document templates shared by other users.
- Request URL:
/api/document-templates - HTTP method:
GET - Authorize:
Bearer token - Parameter: Not required, but additional options can be added below to filter or search the list of document templates.
| Key | Type | Description |
|---|---|---|
search | string | Search information by document template name |
page | int | Page number (default is 1) |
pagesize | int | Page size (default is 10 records) |
Sample request
Query param:
page: 1
pageSize: 20
search: FILE MẪU IMPORT LÔ
Request: /api/document-templates?page=1&pageSize=10&search=FILE MẪU IMPORT LÔ
Sample response body
{
"data": {
"items": [
{
"id": 1149,
"name": "FILE MẪU IMPORT LÔ",
"createdDate": "2022-11-22T14:18:25.3990136",
"fileName": "HĐ Dịch vụ Cấp nước Dochub.docx",
"createdByUser": {
"id": 2341,
"comId": 164,
"code": "phannhan",
"name": "Phan Nhan",
"phone": "091938XXXX",
"email": "example@email.com",
"username": "example@email.com",
},
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl": "{HOST}/Api/Download?token=...",
"isDisabled": false,
"isLaborContractTemplate": false
}
],
"totalCount": 1,
"pageCount": 1,
"page": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
},
"success": true,
"code": 0,
"messages": []
}
Response Body Description
| Key | Type | Description |
|---|---|---|
success | boolean | Response status (true: Success, false: Failure) |
code | int | Response code from the system |
messages | array | List of messages or errors returned by the system |
data | object | Object containing the list of document templates and pagination information (see details below) |
Details of data:
| Key | Type | Description |
|---|---|---|
items | array | List of document templates (Array[object]) (see details below) |
totalCount | int | Total number of records found |
pageCount | int | Total number of pages |
page | int | Current page |
pageSize | int | Number of records per page |
hasNextPage | boolean | Whether there is a next page (true: Yes, false: No) |
hasPreviousPage | boolean | Whether there is a previous page (true: Yes, false: No) |
Details of items:
The list contains document template objects with the following properties for each element:
| Key | Type | Description |
|---|---|---|
id | int | Document template ID |
name | string | Document template name |
createdDate | string | Document template creation time (ISO 8601 format) |
fileName | string | Template file name |
createdByUser | object | Detailed information about the user who created the document template: {
"id": "Creator ID",
"comId": "Company ID",
"code": "Creator code",
"name": "Creator name",
"phone": "Creator phone number",
"email": "Creator email",
"username": "Creator username"
} |
downloadUrl | string | URL to download the original file |
pdfDownloadUrl | string | URL to download the file in PDF format |
isDisabled | boolean | Template disabled status (true: Disabled, false: Active) |
isLaborContractTemplate | boolean | Whether this is a labor contract template (true: Yes, false: No) |