Information Task not calling Web service


(Andrew Prokop) #1

Using the bot test tool in the bot development tool, I cannot get the web service in my Information Task to be invoked. I have a parameter and the user is prompted to enter it, but the web service is not called. If I go into the Information Task and press “Test” for the web service, it is called just fine. What might be wrong?

Adding to the post:

I find that if I am very patient, the web service is invoked. In my latest test, it took over six minutes for the call to be made.

Once the call is made, I do not see anything returned to the bot. The message comes back from my web service as:

{“fulfillmentText”:“Type is Incident. Customer Name is The University of the Arts”}

In the API Request tab / Sample Response tab, I see the following format:

{
“request”: {
“ticket”: 123456
},
“labels”: {},
tenant”: “”,
“response”: {
“fulfillmentText”: “Type is Incident. Customer Name is Dick’s Sporting Goods”
},…

Under Bot Response, I have coded both:

<%=response.fulfillmentText%>

and

<%=fulfillmentText%>

However, neither works and nothing is ever displayed.


Another update:

All of a sudden the web services call is being made much quicker.

However, the Sample Response now looks like the following. Note the sudden appearance of the array. That was not there just a couple hours ago.

{
“request”: {
“ticket”: 123456
},
“labels”: {},
tenant”: “”,
“response”: {
“fulfillment”: [
{
“fulfillmentText”: “Type is Incident. Customer Name is Dick’s Sporting Goods”
}
]
},…

I tried to do this in my Bot Response, but still nothing is shown to the bot user:

<%=response.fulfillment[0].fulfillmentText%>

I then simplified my Bot Response to this: Thank you.

It still doesn’t display anything to the user.


(Subrahmanyam Donepudi) #2

@aprokop An information task will be used to display the result in a report template. Could you please let me know if you have configured the ‘report template definition’ under the ‘bot response’ tab of your information task?

Also for the report to be presented, you will need to apply a processor (Extract) to extract the elements present in the key (which is an array) so that they could be utilized at the records of the template.

Below configuration could guide you in building an information task. We have used a dummy endpoint (https://jsonplaceholder.typicode.com/posts) which contains details of userId and title as keys in the response which we would use to present the report when the Information task is executed.

Screenshot of the created information task
image

API configured at the information task
image

Processor for assigning the response to key ‘data’ (Note: As your response already contains a key which is an array and you were extracted information from it, this step might not be needed)
image

Processor for extracting each element of the key ‘data’ which is created at the previous step
image

Configuring the report template definition at bot response tab
image

image

image

Configuring the message definition for presenting the response to the user.

image

The details of the configured report should be available at ‘Report Keys’
image

Executing the information task from ‘Talk to bot’
image

Screenshot of the report displayed when the link in the bot response is accessed.
image

Note:

  • If you were to display the details without the use of a report template, please choose the ‘Action Task’ over ‘Information task’.
  • All use cases which can be built using Action tasks or information tasks can be built using ‘Dialog’ tasks as well and we recommend developer using Dialog tasks as they provide more configurable options.
  • Report templates can also be presented using Dialog task. Please refer to the below topic for more details.

(Andrew Prokop) #3

Thank you @Subrahmanyam. I am very new to your platform and it appears that I chose the wrong Task to implement. I am now using an Action Task and with that I can get the data sent to my webhook and the proper answer displayed to the bot user.

Additional Questions.

Is there a way to get the Intent passed to the webhook via an Action Task along with the parameter/entity? Right now I simply see my parameter as: {“ticket”:123456}

My bot always asks to verify the user input. For example, if I type “Find ticket 123456” it always asks me to confirm. I do not see where verification can be disabled.


(Subrahmanyam Donepudi) #4

@aprokop The below option allows the developer to turn ON/OFF the confirmation from the user once all the parameters are received.

image

Could you please provide more details on this? Would you like to send the NLP analysis information to a webhook URL when the intent is identified?

As I mentioned previously, we’d recommend developers using the dialog tasks over the Action tasks in which case the user provided inputs (Utterance, entity values and the response to endpoints and much more) would be available as part of context data.

This information can be used to frame logic at nodes of Dialog tasks using the JS editor, configure the transitions to further nodes of the dialog etc.

Could you please configure the same task using a Dialog task instead of Action task? During execution, please open the debug console and look at the session and context variables tab which details the information available in context data.

Please refer to below topics on Dialog task configuration and context object:

https://developer.kore.ai/docs/bots/bot-builder-tool/dialog-task/dialog-tasks/
https://developer.kore.ai/docs/bots/bot-builder-tool/dialog-task/context-object/