Skip to main content
Version: 2.0.0

Message Processing

Feature Target

In order to facilitate customized development, message processing is supported in version 1.11 and later versions. This function allows user messages to be sent to the dialogue engine before calling the configured interface address for pre-processing. The dialog engine generates reply answers based on processed user messages. Before sending the answer to the user, the configured interface address will also be called for post-processing, so that the user can receive the adjusted and enhanced message answer.

Interface Definition

Pre-processing

1) Request method

POST

2) Request parameters

content: the message entered by the user metadata: original data and user attributes

{
"msg_body": {
"text": {
"content": "A message entered by the user"
}
},
"metadata": {
"Metadata Key": "Metadata Value"
},
}

3) Response parameters

In the same format as the request parameter, you can modify the contents of the content and metadata fields, and the dialog engine will generate a reply based on your adjusted user message. If the pre-processing interface of the request configuration reports an error or times out, the original user message will be used to save the city and reply the answer.

Post-processing

1) Request method

POST

2) Request parameters

msg_body: Respond to the user's answer, the following example gives a text type answer.

{
"msg_body": {
"text": {
"content": "string"
}
}
}

3) Response parameters

Consistent with the request parameters, you can modify the content of the "msg_body" field. After the dialogue engine generates an answer, it will call the configured post-processing interface and send the post-processing adjusted answer content to the user. If the interface times out or reports an error, the answer generated by the dialogue engine will be sent.

Message Processing Configuration

Custom Chat API Channel

openapi-config-en-v1.11

Web Widget Channel

web-widget-config-en-v1.11