on 08-05-2022 4:03 PM
How can I access the response from a webhook call within SAP CAI?
I think there was a misunderstand of how the 2 capabilities work involving calling an API.
Inside an action, you can call an API in 2 ways:
So ... in your response above, the format of the response is designed to automatically display as a message whatever is in the content field. But `$(property.Response)` would have no meaning for the chatbot, except as text. Your webhook has to send whatever text you want to be displayed in the message, in the format as described in the link above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The webhook response will directly be added to the bot response. The replies will be added to the messages and the conversation node will impact memory and language. More details can be found here.
If you want to use an API where the response needs to be transformed or only parts of the response should be used in further actions please refer to "consume API service" action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Webhooks need to match the following response structure:
{
"replies": [
{
"type": "text",
"content": "Hello world!"
}
],
"conversation": {
"language": "en",
"memory": {
"user": "Bob"
}
}
}
If the API called in your case does not match this structure "Consume API service" needs to be used instead of Webhook. The response of Consume API Service can be accessed with {{api_service_response}} afterwards.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.