Reply
Set Notification Reply
PUT /notification/reply
Projects using chatbots usually have clients replying to messages and projects want to know which message was sent by the client. This endpoint allows us to store the replies on MongoDB and DHIS2.
This Reply endpoint allows setting the replied message of a notification by notification ID or client ID and template ID. Suppose you specify the client ID and the template ID. In that case, we will choose the last notification sent with that template ID. This endpoint provides flexibility to set the reply message and depends on the user the way to reply to a notification.
The notification status will change to replied.
Upon successful reply, a confirmation response will be returned. If the operation encounters an issue or the notification cannot be canceled, appropriate error messages will be provided.
Request Body
{
"project": "",
"templateId": "",
"notificationID": "",
"msg": "",
}
Parameter Name | Type | Required | Description |
---|---|---|---|
project | string | Yes | Reference project to send notifications. This allows the app to store data in a different data persistence tool. Supported values:
|
templateId | string | Optional | Identifier used by the specified channel to use a pre-defined template. If you are not to use notificationID, this will be mandatory |
notificationID | string | Optional | Id assigned to a notification. If you are not going to use templateId and clientId, it will be mandatory. |
clientId | string | Optional | Id assigned to a client. If you are not to use notificationID, this will be mandatory |
msg | string | Yes | The notification reply. It have to be not empty. |
Request body to reply by Notification ID
{
"project": "LAC-FP",
"notificationId": "A019283FD",
"msg": "The notification was received!"
}
Request body to cancel by client ID & TemplateId
{
"project": "LAC-FP",
"clientId": "019283SFD",
"templateId": "template_3",
"msg": "The notification was received!"
}
Responses
200: Success
404: Not Found. The request was processed but the entity was not found.
422: Unprocessable Entity. Missing required properties in Request Body.
Parameter(s) missing
Project ID - Always
OR Msg
OR Client ID + TemplateId
OR NotificationId