Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Dialog API not returning information about the Webhook Calls #148

Open
boudhayan-dev opened this issue Apr 26, 2019 · 4 comments
Open

Dialog API not returning information about the Webhook Calls #148

boudhayan-dev opened this issue Apr 26, 2019 · 4 comments

Comments

@boudhayan-dev
Copy link

I am encountering a very weird problem with the Dialog endpoint of the API ( Dialog Endpoint ). Well, I have set an actions if a particular intent is triggered. The action does the following -

  1. Send a message - "Hello received intent"
  2. Call a Webhook URL - POST https://www.example.com
  3. Send a quick reply - "Successful in calling webhook"

Now, when I am trying to fetch the information about this conversation using the above mentioned endpoint, I am not getting the information about the Webhook call.

Ideally, the messages key in the returned response should contain all the configured responses for a particular Action, right ? . The returned response only contains information about the message and the quick reply . The info about the Webhook call is missing. Sample response below -

"messages": [
     {
       "type": "text",
       "content": "Hello received intent",
       "markdown": null,
       "delay": null
     },
     {
       "type": "quickReplies",
       "content": {
         "title": "Successful in calling webhook",
         "buttons": []
       },
       "markdown": null,
       "delay": null
     }
@dbousque
Copy link
Contributor

Is your server returning responses ? Do you follow the format described here in the "Formatting the response of the webhook call" section here : https://cai.tools.sap/docs/concepts/code-and-webhook ?

@boudhayan-dev
Copy link
Author

boudhayan-dev commented Apr 26, 2019

Hi @dbousque ,

Is your server returning responses ?

Which server are you talking about ?

The flow of a conversation is something like this -

  1. Recast Webchat.js script embedded in UI
  2. Whenever anything is typed into it - "Hey this is test message", the message instead of sending to default Bot Connector dialog endpoint, is send to a endpoint in my Java application.
  3. The Java application after receiving the conversation data, forwards it to the dialog API to receive the NLP analysed content and the response that has been configured for that particular sentence.

In that response, the DIalog API is skipping over webhook details and gives info about all other type of replies starting from text to quick replies, list, carousel etc. I did not have to configure any custom response body in the Actions tab. So why would I need for the webhook specially ??

@dbousque
Copy link
Contributor

Hi @boudhayan-dev,

Webhook actions are actions performing an HTTP call to the specified URL with the specified parameters and headers. If the HTTP call made to the URL returns responses in a certain format, theses responses will be added to the bot responses to the user message. If the HTTP call doesn't return responses in the expected format, the call will have no effect to the conversation.

I hope this is clearer now :) Take a look at the full documentation for more details about what the different kinds of actions are.

@boudhayan-dev
Copy link
Author

Hi @dbousque ,

I think you are confusing yourself with Dialog API endpoint and Webhook URL. I am aware of the working of webhook under Actions tab. My question is not related to webhooks at all.

Dialog API - https://cai.tools.sap/docs/api-reference/#dialog-endpoints

The payload of this endpoint is supposed to contain all the replies set for a particular skill. Check the sample payload attached in the documentation. There exists a key called message which contains the replies.

The messages section contains the replies you can send back to the user given its input.

So, if I have configured 3 different types of replies in the skill section, they should come up in the message section.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants