Get Device Location - Google Assistant - actions-on-google

I am using #assistant/conversation and I need to get the user’s device location in one of the handlers. I can’t find any documentation about this. There used to be permission helpers in actions sdk which could be used to get the exact location, but there is no information about implementing this in the conversational actions and nothing about requesting permissions in the Fulfillment Migration Docs as well. This is what I am trying to implement. Permissions
I also found this question which is still unanswered.

Related

OAuth account linking in conversational actions

I have created a conversational action in Actions Builder that uses account linking via OAuth (not Google sign in). Functionally, everything is working well.
The only issue I noticed is that when I try to link accounts using anything except a phone in the simulator, I get a response telling me to link accounts using the Google Home app. Since my action is a conversational action and not a smart home action, my action will never be found in the Google Home app.
I have confirmed that this kind of account linking is supported with conversational actions (via docs as well as Actions on Google support). What support could not answer for me is what I can do about this, they directed me here for help.
So my question is, how is account linking handled for conversational actions on non-phone devices (e.g. smart speaker)? Does it simply not run at all, or do I have to do something to remove these Google Home prompts?
Thanks
If the Action is running on a device type that does not support a web browser then the authentication step is not going to work. If you have not signed in before, the operation will fail. Though if you have signed in already, any device will be able to retrieve your access token.
The way to do this would be to handle cases for a non-authenticated device that cannot be authenticated. This may mean providing some part of your Action that can run in these conditions. Alternately, you'll need to inform people that they'll first need to use their phone to perform account linking.

DialogFlow: Google Calendar Event function from Google Actions (Oauth2)?

I have created an agent in DialogFlow that interacts with the user giving her the ability to check for details like demographic from a back-end database. I have achieved this using Fulfillment/Webhook calls and have successfully parsed/returned different types of Responses to the user to play with. I have tested this on both an Android device and the Google Actions Simulator.
Now, what I want to achieve is to give user the ability to "Set a Reminder" on a platform like Google Calendar or similar through my App. By default, Google Assistant does this by simply telling it to "remind me..." and Google creates a reminder in the calendar. But as soon as I invoke my app, the Assistant is out of scope so using the "remind me" command won't work. I want to use the Google Calendar for example to create a reminder through my agent so that the user is notified at the due time.
I understand that when the user invokes an App in Google Assistant, she is using her Google credentials so I guess if I want to use the App to create a reminder, I should have the option. I have had a look at the Calendar API but I am not sure if I should proceed that way. Is there a better way of achieving this?
Please note, I want to use a reminder service that is available to the user without subscribing to a third-party service.
The Calendar API is the way to go. Details here.
In those docs you'll see reference to the access token, which you can get by using the helper intent askForSignIn (example of use here in one of Google's example projects).
Hope this helps!
So for all those who are facing the same issue, here is what I did:
First created an account on https://auth0.com
Followed this guide to configure the necessary settings to link to Google Assistant (ignored the Jovo part)
Used Auth0 guide to configure and link to my Google project credentials (ignored the Admins SDK Service part)
Now when I run my Google Actions App on the device, a button "Link [App Name] to Google" showed up. Clicking on that "signed me in".
Parsed the response in my webhook to grab originalRequest.data.user.accessToken
This is the token mentioned in #lukedavis answer. The next step was to use the token to execute a call to the Calendar API. Upon trying that, I am facing a different problem which I am trying to find the solution for. But the above should assist those who wish get the accessToken.

Developer Access to Google Assistant Conversation History

I am developing a Google Assistant app for Google Home, and about to launch the app. I am wondering, once my app is live on the Google Assistant platform, whether I (as a developer) would have access to all of the conversation histories as users interact with my app.
If so, does Actions on Google / Google have some sort of interface to view / download the history? Or, do I have to log and capture the history myself? I thought the history will be really helpful for me to improve my app.
Many thanks!
It depends a bit on how you have built your Action.
If you have built it with one of the templates - then no, you don't have access to the conversations.
If you have built it with the Actions SDK or with Dialogflow, then you will have access to quite a bit of information that is delivered to your fulfillment webhook. If you have intents that do not send anything to your webhook - you will not get that information.
There are tools that help you examine conversation flow, see where users get stuck or fall out of the conversation, or how they're using your Action. Most of them have good integration with the Actions on Google libraries. I use a combination of Chatbase, Dashbot.io, and Google Analytics.

Set up News source for Google Home

I work for a publication and would like to find out how I can enable our site to be read by Google Home or if there's something I need to do to set that up. I've looked at the Google Assistant SDK but it seems to be geared more towards custom commands to your own device like a Raspberry Pi etc.
Thank you!
You're right, the Google Assistant SDK is for building your own Assistant hardware.
The Actions on Google API is for building Actions that work with the Google Assistant on multiple platforms. With this, you can build an Action that responds to requests to "Hey Google, Talk to your action name". Google also reviews these Actions periodically to find ones that may more directly respond to questions such as "Hey Google, tell me the news".
There is currently no way to explicitly have your audio included as part of Google Assistant's "Good Morning" news briefing list, although Google may use RSS streams or other public feeds to make such content available.
Update
Google just announced formalizing what they call Content Actions, which are the formal way to get specific content such as poscasts, news, and recipes through the Assistant. See the documentation for details, but in your case, they've documented what the RSS feed should look like.

Why am I getting "The authenticated user has not installed the app with client id" error when using the Google Drive API natively?

I'm working on a Google Drive interface for Emacs. The concept is that Emacs could provide a platform-agnostic way to load, modify and save text documents stored in Google Drive. I've registered my app and can authenticate with OAuth2 and get a file listing with the Docs List API, but when I try to execute an Insert with the Google Drive API, I see an error:
"The authenticated user has not installed the app with client id ..."
Reading further, it seems I need to publish my Emacs application in the Chrome Web Store to get access to the Drive API. That doesn't make sense to me...I noticed that there is a FUSE project in development for Google Drive, which suggests that native development is possible. When I skimmed the code, however, I didn't see a Chrome Web Store component to getting it working.
Am I trying to misuse the API, or is there an route to make this work that makes more sense?
EDIT:
According to Ali Afshar, of the Google Drive team, installation is no longer required to use this API. So what follows may no longer be relevant, but will be left for historical purposes.
So, first off the API does not support application development in the sense that we are both doing it, I wouldn't use the word native though. The good news is I have been doing some research and Google Drive is really just a rebranding of Google Docs. So the Google Docs API could be a good choice as well for the same purposes.
Anyway, here's the steps to solve the error: "The authenticated user has not installed the app with client id ..." Which is a 403 error, for the sake of this answer. These steps assume you have set up an app in the chrome web store as is required, and installed it. I am working on my local machine too, with my project: http://github.com/tom-dignan/gdrive-cli which I have gotten past this error, so I think you should keep plugging away at your emacs version, because I think we can make this work.
a. Open the Google APIs console.
b. Confirm you've already enabled the apis under "API Access" both the API and SDK for Google drive should be enabled. There you get your client secrets/api keys and such. I am almost positive you've done this already, so go ahead to C. (this is here for others who may have missed it)
c. In the left navigation bar, under "Drive SDK" you will need to do the following:
Add a "Support URL" (required)
Add at least a small 16x16 application icon (required)
Add "OAuth Client ID (Required)" under Drive Integration (I was just tinkering and this seems to be the key field.)
Add "Open URL (Required) URL to open for your app from the google drive UI."
Check off "Multiple File Support"
Add some MIME types and file extensions, "text/plain", and txt for example
Add the the auth scopes:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
Don't bother trying to add the auth scopes for Google Docs here, because it won't work. Google does not want us to use it that way because files that drive apps create should be private to that app. Integration with Google Docs will have to be separate.
Now I know you must be thinking "why do I have to add some of these..." It's because the form makes them required fields. In mine, I put a couple URLs that point to static HTML pages.
Once you've done the above, clean up your state and reinstall your chrome app. Then try your code again, and it should stop giving you a 403.