2

This question pertains specifically to Actions on Google Apps and is concerning the ability to trigger an event/action to cause the Assistant to choose another AoG app for the end user; specifically to trigger someone else's AoG app, not one that you have written.

Idea: I want to create a custom AoG app. Something like planning-for-a-hike app. I want my user to be able to ask about the weather. At that point, I want to pass the flow over to an already existing app to get the weather. ie. while using my app the user says "Okay, sounds good. So what's the weather looks like today?" and at that point I want to trigger the default weather app by passing a specific phrase back to the assistant or writing an intent.

I'm familiar with the concept of Dialogflow followup event sent back from fulfillment but am pretty sure I could not use such an intent to trigger an entire app that I didn't write. Intents exist within apps as I understand them. It is the Google Assistant that decides which app to trigger and appears to me that it doesn't have an API exposing that functionality.

If such a thing is possible, how would it look?

Thanks!

Nazeem
  • 468
  • 2
  • 9
DMS
  • 133
  • 7
  • 2
    Sorry but I'm not seeing how this is a duplicate question. That past post is regarding Android Apps. This question is specifically for Google Home Apps regarding triggering an app via a followup event sent from fulfillment in a webhook. – DMS Feb 11 '18 at 16:33
  • Your question is still not well constructed. Lay out the problem before the sharing the code. Beyond the ["How to ask"](https://stackoverflow.com/help/how-to-ask) advice, you also need to start by stating the question in a way that focuses on what gap remains _after_ your research. Then describe your strategy thus far, code setup + conditions, and the errors/issues. Also state 'obvious' context that you already know, so that people understand what you have tried. See also [1](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/), [2](https://stackoverflow.com/help/mcve) – New Alexandria Feb 11 '18 at 18:53
  • 1
    Why is this marked as duplicate? The marked duplicate question is not relevant in any way to this one. – Nazeem Feb 11 '18 at 20:53
  • This is definitely not a duplicate question. – Alex Bravo Jul 11 '19 at 17:28

1 Answers1

4

Invoking AoG apps can only done by Google but you might be able to trigger any intent with an event from a different Dialogflow agent from your webhook by making either a :

GET request from your webhook like:

curl \
-H "Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN" \
"https://api.dialogflow.com/v1/query?v=20150910&e=event_name&timezone=Europe/Paris&lang=en&sessionId=1234567890"

or a POST request to it with the headers:

Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN
Content-Type: application/json

and the request body like:

"event":{  
  "name":"<EVENT_NAME>",
  "data":{
      “<PARAMETER_NAME>”:”<PARAMETER_VALUE>”  
  },
  "timezone":"America/New_York",
  "lang":"en",
  "sessionId":"1321321"
}

Note that you need to have access to the other agent's Dialogflow access token

Nazeem
  • 468
  • 2
  • 9
  • Thanks. I think you confirmed what I suspected. Without that access token (which I'm not going to have for stock apps) I'm not going to be able to call someone else's app from within my own. – DMS Feb 11 '18 at 20:10
  • Happy to help! If this answer or any other one solved your issue, please mark it as accepted – Nazeem Feb 11 '18 at 21:06