Clickable response such as a button in Dialgflow
up vote
0
down vote
favorite
I have been developing a chatbot for my android app using dialogflow and its working perfectly. But now I've a requirement to get a clickable response from my chabot. For example, let's say that the app user is asking for a specific location. I want Dialogflow chatbot to return a button or a link as the response so that the user could click on that and be redirected to the google maps.
I have went through a lot of tutorials, blogs and docs yet I've not been able to find a satisfying answer. If you could help me with a code example as well, that would be really appreciated.
Thank you in advance
android dialogflow
add a comment |
up vote
0
down vote
favorite
I have been developing a chatbot for my android app using dialogflow and its working perfectly. But now I've a requirement to get a clickable response from my chabot. For example, let's say that the app user is asking for a specific location. I want Dialogflow chatbot to return a button or a link as the response so that the user could click on that and be redirected to the google maps.
I have went through a lot of tutorials, blogs and docs yet I've not been able to find a satisfying answer. If you could help me with a code example as well, that would be really appreciated.
Thank you in advance
android dialogflow
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have been developing a chatbot for my android app using dialogflow and its working perfectly. But now I've a requirement to get a clickable response from my chabot. For example, let's say that the app user is asking for a specific location. I want Dialogflow chatbot to return a button or a link as the response so that the user could click on that and be redirected to the google maps.
I have went through a lot of tutorials, blogs and docs yet I've not been able to find a satisfying answer. If you could help me with a code example as well, that would be really appreciated.
Thank you in advance
android dialogflow
I have been developing a chatbot for my android app using dialogflow and its working perfectly. But now I've a requirement to get a clickable response from my chabot. For example, let's say that the app user is asking for a specific location. I want Dialogflow chatbot to return a button or a link as the response so that the user could click on that and be redirected to the google maps.
I have went through a lot of tutorials, blogs and docs yet I've not been able to find a satisfying answer. If you could help me with a code example as well, that would be really appreciated.
Thank you in advance
android dialogflow
android dialogflow
asked Nov 11 at 7:31
Yashodha Pieris
81
81
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
If you are using Dialogflow to integrate with your own system (as opposed to something like Facebook Messenger, Actions on Google, or other bot platforms) using the Detect Intent API, then you can include any data you want in the payload
object of your webhook response. This is passed back to you in the response to your Detect Intent call in the response body in the queryResult.webhookPayload
object.
You can include in here any information you wish, and render it however you'd like.
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
add a comment |
up vote
0
down vote
You may have to use Google Maps URLs for this purpose. These provide a Universal Cross-platform solution.
Follow these steps:
Based on user Responses, encode a Map URL as shown in examples here https://developers.google.com/maps/documentation/urls/guide
For example, consider the URL from the guide above
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY
Then use
Buttons in Basic Card as follows
app.intent('demo', (conv, params) =>
// Create a basic card with the URL
conv.ask(new BasicCard(
text: `This is a basic card with Map Response.`,
subtitle: 'This is a subtitle',
title: 'Title: Open Map',
buttons: new Button(
title: 'Open Map as per URL',
url: 'https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY',
)
));
You can also use other Responses (such as linkOutSuggestion ) as described here:
https://developers.google.com/actions/assistant/responses
Hope that helps!
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
If you are using Dialogflow to integrate with your own system (as opposed to something like Facebook Messenger, Actions on Google, or other bot platforms) using the Detect Intent API, then you can include any data you want in the payload
object of your webhook response. This is passed back to you in the response to your Detect Intent call in the response body in the queryResult.webhookPayload
object.
You can include in here any information you wish, and render it however you'd like.
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
add a comment |
up vote
1
down vote
If you are using Dialogflow to integrate with your own system (as opposed to something like Facebook Messenger, Actions on Google, or other bot platforms) using the Detect Intent API, then you can include any data you want in the payload
object of your webhook response. This is passed back to you in the response to your Detect Intent call in the response body in the queryResult.webhookPayload
object.
You can include in here any information you wish, and render it however you'd like.
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
add a comment |
up vote
1
down vote
up vote
1
down vote
If you are using Dialogflow to integrate with your own system (as opposed to something like Facebook Messenger, Actions on Google, or other bot platforms) using the Detect Intent API, then you can include any data you want in the payload
object of your webhook response. This is passed back to you in the response to your Detect Intent call in the response body in the queryResult.webhookPayload
object.
You can include in here any information you wish, and render it however you'd like.
If you are using Dialogflow to integrate with your own system (as opposed to something like Facebook Messenger, Actions on Google, or other bot platforms) using the Detect Intent API, then you can include any data you want in the payload
object of your webhook response. This is passed back to you in the response to your Detect Intent call in the response body in the queryResult.webhookPayload
object.
You can include in here any information you wish, and render it however you'd like.
answered Nov 11 at 14:18
Prisoner
30.5k22551
30.5k22551
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
add a comment |
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
thank you so much for your help @Prisoner. Could you give me a sample code on how to do what you suggested?
– Yashodha Pieris
Nov 11 at 15:53
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
It is difficult to provide you sample code since you haven't provided any to build from, so I'm not sure if you want sample code on the webhook fulfillment, in your client, etc.
– Prisoner
Nov 11 at 17:48
add a comment |
up vote
0
down vote
You may have to use Google Maps URLs for this purpose. These provide a Universal Cross-platform solution.
Follow these steps:
Based on user Responses, encode a Map URL as shown in examples here https://developers.google.com/maps/documentation/urls/guide
For example, consider the URL from the guide above
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY
Then use
Buttons in Basic Card as follows
app.intent('demo', (conv, params) =>
// Create a basic card with the URL
conv.ask(new BasicCard(
text: `This is a basic card with Map Response.`,
subtitle: 'This is a subtitle',
title: 'Title: Open Map',
buttons: new Button(
title: 'Open Map as per URL',
url: 'https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY',
)
));
You can also use other Responses (such as linkOutSuggestion ) as described here:
https://developers.google.com/actions/assistant/responses
Hope that helps!
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
add a comment |
up vote
0
down vote
You may have to use Google Maps URLs for this purpose. These provide a Universal Cross-platform solution.
Follow these steps:
Based on user Responses, encode a Map URL as shown in examples here https://developers.google.com/maps/documentation/urls/guide
For example, consider the URL from the guide above
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY
Then use
Buttons in Basic Card as follows
app.intent('demo', (conv, params) =>
// Create a basic card with the URL
conv.ask(new BasicCard(
text: `This is a basic card with Map Response.`,
subtitle: 'This is a subtitle',
title: 'Title: Open Map',
buttons: new Button(
title: 'Open Map as per URL',
url: 'https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY',
)
));
You can also use other Responses (such as linkOutSuggestion ) as described here:
https://developers.google.com/actions/assistant/responses
Hope that helps!
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
add a comment |
up vote
0
down vote
up vote
0
down vote
You may have to use Google Maps URLs for this purpose. These provide a Universal Cross-platform solution.
Follow these steps:
Based on user Responses, encode a Map URL as shown in examples here https://developers.google.com/maps/documentation/urls/guide
For example, consider the URL from the guide above
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY
Then use
Buttons in Basic Card as follows
app.intent('demo', (conv, params) =>
// Create a basic card with the URL
conv.ask(new BasicCard(
text: `This is a basic card with Map Response.`,
subtitle: 'This is a subtitle',
title: 'Title: Open Map',
buttons: new Button(
title: 'Open Map as per URL',
url: 'https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY',
)
));
You can also use other Responses (such as linkOutSuggestion ) as described here:
https://developers.google.com/actions/assistant/responses
Hope that helps!
You may have to use Google Maps URLs for this purpose. These provide a Universal Cross-platform solution.
Follow these steps:
Based on user Responses, encode a Map URL as shown in examples here https://developers.google.com/maps/documentation/urls/guide
For example, consider the URL from the guide above
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY
Then use
Buttons in Basic Card as follows
app.intent('demo', (conv, params) =>
// Create a basic card with the URL
conv.ask(new BasicCard(
text: `This is a basic card with Map Response.`,
subtitle: 'This is a subtitle',
title: 'Title: Open Map',
buttons: new Button(
title: 'Open Map as per URL',
url: 'https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY',
)
));
You can also use other Responses (such as linkOutSuggestion ) as described here:
https://developers.google.com/actions/assistant/responses
Hope that helps!
answered Nov 11 at 11:08
sai.raj
1338
1338
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
add a comment |
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
Thank you so much for your comment. But isn't basic card responses support only to existing clients like messenger, viber and etc? I have been looking around a lot and that's what I found out. Please correct me if I'm wrong.
– Yashodha Pieris
Nov 11 at 11:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246705%2fclickable-response-such-as-a-button-in-dialgflow%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown