Skip to main content
Version: 2.3.0

Batch process document

Updated date: 01/07/2024
Updated by: VNPT eContract's team


Purpose

The function performs batch processing of documents according to batches of documents, including: signing and approving documents.

Caution

The function processes documents and requires the batchProcessId information from the Create batch process API.

  • Request URL: /api/documents/batch-process
  • HTTP method: POST
  • HTTP content-type: application/json
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
batchProcessIdstring[Required] Id of batch process data.id (get form Create batch process API response)
reasonstring[Required] Reason
rejectboolean[Required] Reject the document
true: Reject the document
otpstring[Required] OTP confirmation code
// pass null for the first time,
// pass the OTP value for confirming/rejecting document in email/sms
signatureDisplayModeint[Required] Signature display mode
1: Text only
2: Text and image
3: Image only
signatureImagestring[Required] Signature image
// base64 string of the signature image
signingPageintSign page
signingPositionstringSignature position / coordinates
Rectangle = llx, lly, urx, ury
llx, lly = coordinates of the bottom-left corner of the signature
urx = llx + width
ury = lly + height
The coordinate origin is the bottom-left point of the document
signatureTextstring[Required] Note
fontSizeint[Required] Font size
showReasonboolean[Required] Display reason
false: do not display reason
true: display reason
confirmTermsConditionsboolean[Required] Confirm legal terms before processing documents
false: Do not agree
true: Agree

Sample request 1st

{
"batchProcessId": "673c0f4f-8744-4cf7-1061-08dc9a457201",
"reason": "Sign this valid documents",
"reject": false,
"otp": null,
"signatureDisplayMode": 3,
"signatureImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAD…",
"signingPage": null,
"signingPosition": null,
"signatureText": "Tran Viet Trinh",
"fontSize": 12,
"showReason": false,
"confirmTermsConditions": true
}

Sample response body 1st

{
"data": {
"isBatchProcess": false,
"isSingleProcess": false,
"isProcessedByWorkerService": false,
"batchProcessId": "673c0f4f-8744-4cf7-1061-08dc9a457201",
"documentId": "00000000-0000-0000-0000-000000000000",
"documentIds": [],
"accessPermission": 2,
"signMethod": 2,
"signatureDisplayMode": 2,
"batchProcessStatus": 0,
"signingPage": 0,
"signatureText": "Ky hang loat",
"reason": "Dong y voi noi dung trinh ky",
"confirmReason": "Dong y voi noi dung trinh ky",
"showReason": false,
"fontSize": 0,
"receiveOtpMethod": 2,
"receiveOtpPhone": "0912345678",
"receiveOtpEmail": "trinhttv@email.com",
"requireOtpConfirmation": true,
"vnptCaPluginAdvancedSign": false,
"drawSigns": [],
"documentMessages": [],
"histories": [],
"digitalSignatures": [],
"processes": [],
"documents": [],
"sharedUsers": [],
"sharedDepartments": [],
"sharedUserGroups": [],
"sharedUserIds": [],
"sharedDepartmentIds": [],
"sharedUserGroupIds": [],
"signatureVerifications": [],
"confirmTermsConditions": false,
"documentIndex": 1,
"fillingItems": [],
"isFillPreview": false,
"isSmartCaLoginRequired": false,
"isBusinessSmartCaAccount": false,
"smartCaCerts": []
},
"success": true,
"code": 100,
"messages": [
"Send confirmation otp success"
]
}

Sample request 2nd (After receiving the OTP code from Email/SMS)

{
"batchProcessId": "673c0f4f-8744-4cf7-1061-08dc9a457201",
"reason": "Sign this valid documents",
"reject": false,
"otp": "089278", // OTP will be sent to the user's email or SMS
"signatureDisplayMode": 3,
"signatureImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAD…",
"signingPage": null,
"signingPosition": null,
"signatureText": "Tran Viet Trinh",
"fontSize": 12,
"showReason": false,
"confirmTermsConditions": true
}

Sample response body 2nd

{
"success": true,
"code": 0,
"messages": [
"Sign draw batch document success"
]
}