Google Assitant calling webhook - actions-on-google

How i can call web hook after user input and send input in web-hook on my own server and send response to Google
Blockquote
assitant display

If you're using Actions Builder in the Actions Console, you will set up a webhook selection in the intent handlers (or the On Enter event).
In the screenshot below, I have an example scene TestScene. You see that when the intent stay is matched, I have checked the Call your webhook option, which will call my webhook with the handler my_handler_name. Then my webhook can process the request and generate a response, which will be returned to the user.

Related

Failure events behavoir for DISCONNECT Intent

I'm implementing a Handler for the DISCONNECT Intent, and by reading the online documentation https://developers.google.com/assistant/smarthome/reference/intent/disconnect, I see that it is no such response format and it is not a reference in case of fail event, when for example we return an error in event that we didn't properly handle the disconnect or Google API did not reach our server. Does Google Assistant implement some sort of automatic retry logic so that in event of error it automatically resends the requests for a certain amount time. In other words is it a way to tell to the google assistant to retry or return some error to the user that made the DISCONNECT request?
There is no response format for the DISCONNECT intent in the https://developers.google.com/assistant/smarthome/reference/intent/disconnect documentation because nothing is returned when the action.devices.DISCONNECT intent is executed (eg. Google does not retry based on your response status code). You can find more information on this at https://developers.google.com/assistant/smarthome/develop/process-intents#unlink
After an action.devices.DISCONNECT intent is sent, the Assistant stops sending any more intents for the user who has just been disconnected, and the associated cloud service also stops calling Home Graph APIs (Request Sync and Report State) for their devices and a SYNC request is triggered.

Push Notifications with Conversational Webhook

I'm trying to get permission to send push notifications on Google Assistant through the conversational webhook.
I'm following the steps here under Actions SDK JSON
I have the first part with "Hi! Welcome to Push Notifications" working.
Then I send the second response under the ask for the UPDATE permission.
The problem is that it seems this is triggering some event on the google assistant side where it asks again for permission to send notifications see here
I think this requires me to define some other intent but how do I properly handle this so it will send me the request with the userID?

Google action "isn't responding right now" after account linking completed

Im developing a google action with account linking.
When a new user does an initial request to my action, I get it over the webhook and respond with the SIGN_IN response. The assistant asks the user to link the account. The users does so, and the action then reports "XXX isn't responding right now", yet there were no further webhook requests to respond to. There is nothing in the logs viewer other than the initial request.
The next request by the user works fine, indicating that account linking did indeed complete. How can I avoid this error to the user??
This is usually because you either have no Intent in Dialogflow which can handle the actions_intent_SIGN_IN event or you have one and it is not set to do webhook fulfillment and returns no response.

How to detect standby event from Messenger?

Using Messenger Handover protocol I can pass the control to inbox when user requests to talk to a human. I want the bot to listen on standby in order to take the control back when user requests it. The problem seems that the bot doesn't listen on standby.
My Facebook page is subscribed to Standby event and Webhooks integration is enabled in my Messenger app. In DialogFlow the Facebook Messenger integration is set. In the fulfillment code I don't receive requests after handing the conversation thread control over to inbox.
Please help!
I have an idea for this, but actually I'm not sure if it wil work, I'll just post it to see if anyone maybe has tried it.
I think you should create an own webhook, this is going to be subscribed in the Facebook App Messenger Webhook in Facebook Developers Portal.
You will have to set your this webhook to receive all the corresponding events from Facebook, like 'messaging', 'standby, 'messaging_handovers', etc (currently 'messaging' event is used to send the messages from users, and 'messaging_handovers' and 'standby' are used to switch control from bot (DialogFlow in your case) to another app (could be inbox page).
Then, you will have to set up your webhook, depending on the callback received, like this:
- If request_thread_control callback is send: the webhook should send a pass_thread_control to the second reciver
- you will have to set up a protocol to activate take_thread_control, to return the ownership of the conversation to the bot
- In any other callbacks (asuming the rest are for the messages send to the bot), the webhook should send them to Dialogflow using a client of it inside your webhook, evaluating if the bot has the ownership of the conversation or another app has (again could be another app or inbox)
As I said, it's just an idea, I'm not sure if it will work. Hope it helps somone!
References:
https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control (Passing Thread Control to the Page Inbox (Live Chat))
https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control#page_inbox (Requesting Thread Control From the Page Inbox)
*This is an idea to make passing the ownership avoiding to create an intent that do that. Specially if you want to switch between bot and inbox page just moving a conversation from Done to Inbox or from Inbox to Done

Retrieve a list of events for a specific message

I know that I can setup a webhook, then as soon the event happens (user open email, spam, etc) SendGrid will call that webhook. but if for some space of time the webhook is down, how to retrieve events for example for an specific sg_message_id?
I have looked at the documents but I can't find a sample call to do this
SendGrid doesn't have message-level API GET, just the Push-based Webhook. You can review the Activity page for short-term event lists.