Reputation: 31
I have a dialogflow intent that books a room for a library. In that I ask for room number, time, date, email and so on. I want to be able to get the time from an API after I get the room number, and I want to reprompt the user for a time if they provide a time that has already been booked once I check with the API. I'm new to dialogflow and not sure how to do this, I tried googling similar things but all I get are values that programmers set manually and nothing about getting the values from an API. I am using Nodejs webhook for handling the responses.
Upvotes: 1
Views: 79
Reputation: 761
Note that, “Dialogflow maintains a conversation with your end-user via sessions. For each conversation, your service sends end-user expressions to your Dialogflow agent by calling the detectIntent or streamingDetectIntent method of the Sessions type. Dialogflow responds with information about the matched intent, the action, the parameters, and the response defined for the intent.”
If you want to understand way better with an example code, you can check the next documentation that describes how to correctly connect Dialogflow to an API and make calls through it, and you can also see an example code on how to implement this, since it tells you how to properly create a reservations dialogflow agent, and what you want to achieve.
Also, what I would like to recommend for your case,you might to also make use of google actions with dialogflow since this would make easier the creation of reservations within dialogflow and also it guides you on how the conversation is made.
Upvotes: 1