Skip to main content
Version: 2.2.0

Create document

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


Purpose

The function performs the creation of new document information.

  • Request URL: /api/documents/create
  • HTTP method: POST
  • HTTP content-type: multipart/form-data
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
nostring[Required] No of document
subjectstring[Required] subject of document
filefile[Required] File of document (PDF format)
descriptionstringDescription
typeIdint[Required] Id of document type
documentTemplateIdintId of document template
departmentIdint[Required] Id of department
customerCodestringCustomer code
customerInformationstringCustomer information
relatedDocumentIdsArray[int]Array of related document Ids
attachmentsArray[file]Array of attached files

Sample response body

{
"data": {
"id": "67f7f485-3c65-4e5a-a8fd-08dad7588424",
"createdDate": "2022-12-06T14:07:19.7166444+07:00",
"lastModifiedDate": "2022-12-06T14:07:19.7168438+07:00",
"no": "177667",
"subject": "Create document via API",
"hasVerified": false,
"fileType": 0,
"status": {
"value": 1,
"description": "New document"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "Create sample document via API",
"createdByUserId": 2341,
"processRecipientCount": 0,
"processInOrder": false,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isCancelable": true,
"isEditable": true,
"isShareable": false,
"isAccessable": false,
"isExpired": false,
"canDownload": false,
"type": {
"id": 46,
"code": "CKDS",
"name": "Sales discount",
"description": "Sales discount documents",
"documentCount": 1
},
"processes": [],
"histories": [
{
"createdDate": "2022-12-06T14:07:20.0170103+07:00",
"requestType": {
"value": 0,
"description": "Web"
},
"ipAddress": "10.70.39.66",
"activity": {
"value": 1,
"description": "Create document"
}
}
],
"attachments": [],
"relatedDocuments": [],
"messages": [],
"file": {
"name": "Document.pdf",
"size": 1194181
},
"downloadUrl": "{HOST}/Api/Download?token=..."
},
"success": true,
"code": 0,
"messages": [
"Create document success"
]
}