Webhook
Updated date: 06/11/2024
Updated by: VNPT eContract's team
Purpose
The partner has developed a RESTful API with the following parameters to receive and process data from the webhook:
- URL endpoint (provided by the partner), example:
https://domain-partner.com/api/document/status
- HTTP method:
POST
- HTTP content-type:
application/json
- Authorization:
Bearer token
(optional if security is needed) - Payload: Data will be sent by the VNPT eContract system in JSON format with the following structure:
Sample Payload (the partner's system will receive)
{
"DocumentNo": "HD.001",
"DocumentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b",
"DocumentStatus": {
"Value": -1,
"Description": "Rejected"
},
"Reason": "Document no is incorrect format",
"DatetimeNow": "2024/11/06 14:56:50"
}
Data description
Key | Type | Description |
---|---|---|
DocumentId | string | Id of document |
DocumentNo | string | Code of document |
DocumentStatus | object | Status of document, reference Get list of documents |
Reason | string | Reason cancel document |
BatchProcessId | string | Document batch processing Id (in case of an event processing multiple workflows) |
BatchImportId | int | Document import batch Id (in case of an event completing batch creation of documents) |
DocumentIdInBatchImport | Array[int] | List of document Id within the batch (in case of an event completing batch creation of documents) |
DatetimeNow | Datetime | Execute time |
Sample response (reponse to the VNPT eContract system)
{
"success": true,
"messages": "Document status updated successfully."
}