Skip to main content
Version: 2.2.0

Get list of documents

Updated date: 30/04/2023
Updated by: VNPT eContract's team


Purpose

Function to retrieve the document list of the user or documents shared by other users in the system.

  • Request URL: /api/documents
  • HTTP method: GET
  • Authorize: Bearer token
  • Parameter: Not required, but additional options can be added below to filter or search the list of documents.
KeyTypeDescription
statusintDocument status:
1: New document
2: Ready
3: In progress
4: Completed
5: Correcting
-3: Cancelled
-2: Deleted
-1: Rejected
contractStatusintContract status:
0: Not specified
1: Active
2: Nearly expired
-2: Not yet effective
-1: Expired
documentTemplateIdintId of document template
departmentIdintId of department
documentTypeIdintId of document type
recipientIdsArray[int]Array of recipient IDs
createdByUserIdintId of creator
batchImportIdintId batch import
createdFromstringCreate from date
createdTostringCreate to date
completedFromstringCompleted from date
completedTostringCompleted to date
customerCodestringCustomer code
waitToApprovebooleanWait to approve
waitToSignDigitalbooleanWait to digital sign
waitToSignDrawbooleanWait to sign draw
contractValueFromstringContract value from
contractValueTostringContract value to
searchstringSearch information by document code or document name
pageintPage number (default is 1)
pageSizeintPage size (default is 10 records)

Sample request

Query param:
page: 1
pageSize:10
search: FA902
Request: /api/documents?page=1&pageSize=10&search=FA902

Sample response body

{
"data": {
"items": [
{
"id": "fa07d61e-0fff-41a3-e618-08dad69d1b1b",
"createdDate": "2022-12-05T15:45:47.8532528",
"lastModifiedDate": "2022-12-05T15:46:07.5741114",
"no": "177667",
"subject": "Create document via API",
"hasVerified": false,
"fileType": 0,
"status": {
"value": 2,
"description": "Ready document"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "Create sample document via API",
"department": {
"id": 33,
"name": "VNPT eContract Center",
"code": "DHB",
},
"createdByUserId": 1163,
"processRecipientCount": 2,
"waitingProcess": {
"id": "cfa4f1cd-7db3-477d-8de7-08dad69d1b3b",
"createdDate": "2022-12-05T15:45:47.8532366",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"pageSign": 1,
"position": "28,672,208,762",
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 1163,
"documentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b"
},
"processInOrder": true,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isCancelable": false,
"isEditable": false,
"isShareable": false,
"isAccessable": false,
"isExpired": false,
"canDownload": false,
"type": {
"id": 46,
"code": "CKDS",
"name": "Sales discount",
"description": "Sales discount documents",
"documentCount": 1
},
"documentTemplate": {
"id": 1141,
"name": "Sales discount template",
"createdDate": "2022-11-18T16:07:18.1590328",
"fileName": "DocTemplate.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl":"{HOST}/Api/Download?token...",
"isShareable": false,
"isDeletelable": false,
"isUpdateable": false
},
"batchImport": {
"id": 1232,
"createdDate": "2022-12-05T15:45:44.199619",
"uploadedByUserId": 1163,
"numberOfRecords": 2,
"name": "20221205.A5BO",
},
"processes": [
{
"id": "cfa4f1cd-7db3-477d-8de7-08dad69d1b3b",
"createdDate": "2022-12-05T15:45:47.8532366",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"pageSign": 1,
"position": "28,672,208,762",
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 1163,
"documentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b"
}
],
"histories": [],
"attachments": [],
"relatedDocuments": [],
"messages": [],
"file": {
"name": "FA902.pdf",
"size": 186793
},
"downloadUrl": "{HOST}/Api/Download?token=..."
}
],
"totalCount": 1,
"pageCount": 1,
"page": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
},
"success": true,
"code": 0,
"messages": []
}