Google Assistant (Google Home): dynamic response based on web query - google-home

I use an Google Assistant (Google Home) and would have an answer, which my Website gives.
For Example:
- I say: Hey Google, buy 3 Eggs
- my Website is beeing called (Webhook/wget/etc.):
http://url.de/befehl.php?befehl=buy 3 Eggs
or without keyword
http://url.de/befehl.php?befehl=3 Eggs
my Website gives following text/content: ok that was successful
Google simply says this text, which he got from Website: ok that was successful
IFTTT can only send a command to Website (Webhook) and lets google speak a fixed answer, but not dynamic answer.
Is it possible to realize that (IFTTT, Olisto, etc.) ?
It would be possible to run a Script, which itself gets the content/text of an Website and says what the Website gives (IFTTT-Webhook could do this, but says always the same text (not dynamic)).
Any Ideas, Tipps, Tricks?
Greetings,
Niko

It is definitely possible. You don't really need IFTTT.
I'll give you an example with something I am working on. I would assume you are working on Dialogflow to build your voice app.
Important: Calls outside the google network only work from an enterprise app NOT from the free version
You can just make a call from dialogflow like this for example:
const response = axios.post(...);
conv.ask(response.speech);
That is assuming your response from the server looks something like this:
{
status: 200,
speech: "ok that was successful",
response: "ok that was successful"
}

Related

Google picker does not work without filter being applied for some users

we have an integrated with google picker(read-only scope,Docs view) it use to work fine but recently some users are getting blank screens as soon as the pop up shows but when they select some filter everything starts working fine after that no problems.
using developer tools i see all apis returning 200 for that first request
but there were no docs in response(i believe this is the api responsible for bringing docs in picker 'https://docs.google.com/picker/pvr')
when there are no docs returned in above api google is calling another api i assume it is to log error's probably(//docs.google.com/picker/ohnoes)
this api has following error params in it
&error=Cached and requested query mismatch
&line=Not available
&viewToken=["all",null,{"query":null}]
&ms=97
&transferDocs=false
&numErrors=1
has anybody else faced the similar problem
what do error "Cached and requested query mismatch" means in context of drive docs
Fyi - most accounts facing this problem seems like are of company domain for ex "jondoe#company.org"(this is a google account with company domain)
Filters Image
Thanks for your help.
not sure but looks like issue was may be related to google bug
https://issuetracker.google.com/issues/64825685
for me the code that was not working was:
addView(google.picker.ViewId.DOCS)
replaced this code with below code which works as expected
var view = new google.picker.DocsView();
view.setIncludeFolders(true).setOwnedByMe(true).setParent('root');
addView(view).

Gmail contextual gadget

I guess question one is - is it actually possible to create a contextual gadget for gmail right now?
I have spent the last 2 days solid reading the (very out of date) documentation backwards and forwards, and every forum post I could find on the topic. I have tried everything I and see nothing, not even a hint of an error message that might point me in the right direction.
These are the steps I have been following, starting at the start, and going step by step when logged into my google apps domain as admin.
1) In google drive, created a new TestGadget.xml file, shared it publicly across the whole web and copied the contents of the Hello World example code from here https://developers.google.com/gmail/contextual_gadgets into it.
2) In https://console.developers.google.com deleted the previous attempts and created a new project and named it.
3) Once project was created, went to API's (6 were already enabled, have also tried with them removed), clicked Google Apps Marketplace SDK and enabled it.
4) Once enabled, went to API Configuration for Google Apps Marketplace SDK, and go to original console.
now in the apis console -
5) Clicked API Access, then clicked the big blue "Create an OAuth 2.0 client ID"
6) Gave it a name (used the same name as the project, not sure if that matters?) then next, and created clientID settings for both Web Application and Service Account (not really sure what a contextual gadget needs).
7) Went to Google Apps Marketplace SDK options.
Added a description
Added 4 icons
Cleared the checkbox for "Allow individual install"
Added a URL (http://www.google.com) for the TOS just to keep it happy
8) In the extensions section, checked the Universal Navigation Extension, and again pointed it at www.google.com (have to have either this or the drive extension, but neither make sense for a contextual gadget?!)
9) Enabled COB extension.
Extractor URL - google.com:HelloWorld
Gadget URL - https://drive.google.com/file/d/0B9LL5RYGoC4GUUFFU1FtOXpWSms
Param Name - hello (have tried #hello, and other combination too just incase)
Param Value - .*
Scopes - Mail - Subject line, Mail - Message Body
and Saved changes. In other attempts I have tried different extractors from the documentation, and changed the gadget code to match, using the param name specified there e.g google.com:EmailBodyExtractor with email_body and always .* for the value
10) Click Test installation flow , get the grants page appear, agree to conditions, turn ON for my domain, and accept. Then click next next next thru the next bit agreeing to send notifications out.
11) Went to https://admin.google.com/AdminHome?fral=1#AppsList:serviceType=MARKETPLACE , and the app was listed there. Checked the settings, and Data access was granted, and it was ON for everyone.
12) Sent myself an email from a different account sprinkled liberally with 'hello world' in the subject and body.
13) Logged into gmail with https://mail.google.com/mail/u/0/?nogadgetcache=1
... and nothing
14) Bang head against wall. HARD !
15) repeat last 2 steps with a non admin user - still nothing (and no notification of the app either)
16) return to wall . . . . .
What am I missing?
Finally got it working.
The problem was hosting/linking to the gadget on google drive.
With the exact example above, I ftp'd the gadget to my website and linked to it there, and it all started working.
This however is a really annoying way to work, and I have seen a lot of other examples that claimed to use a document on google drive, so is there a proper way to use google drive to host a gadget during development?

How to test Google Plus account existance

I am building a website where a user could specify his social accounts links, I am trying to find a way to test if a google plus account actually exists (social account validation).
I've seen that it is actually possible to test using the GET people/userId but what about curtom urls ? For example if a user has a google.com/+JohnDoe , how would you figure it out? I didn't find anything in the google docs.
It's the same API. GET people/userId and GET people/+JohnDoe both work.
i think google never publish users info or google's huge database, because spammers are searching very hard to that API (for advertising,....)
but you can implement this algorithm:
save ID as string (for example id="mohsensolhnia" or 21 digit number)
redirect to "http://plus.googleapis.com/wm/4/+"+id+"/posts"
if link was wrong you will redirect to "error 404 page"(google page not found) (title is "Error 404 (Not Found)!!1" ;D ;D )
you can do above 3 step with C#/java/phyton/... "selenium webdriver" dll very easy.

YouTube iframe API official example gives errors

As of 2013-04-16 WEST, the official getting started example of the YouTube iframe API results in error messages when run in Chrome 25 on WinXP/SP3:
I am accessing the example hosted on a web server, i.e. not via the local file system.
Am I doing something wrong? Is the example / the API broken? Can you reproduce the issue?
This error message has been around for quite a while -- as this Google Group post explains, it's due to an unresolved (4-year unresolved!) bug in WebKit:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/VKGl4ahBGyk
It shouldn't affect anything -- it certainly hasn't for our projects, and in visiting the demo URL you posted, it looks like it isn't affecting the API functionality there (i.e. in that demo, the video still stops after 6 seconds per what the code states). There was an SO question a while back that thought it might be affecting analytics:
youtube "Unable to post message to..." causing video analytics to not be tracked
But it was never confirmed as being relevant.
It will be interesting to see if Chrome's move to the new Blink fork of WebKit leads to the bug itself being resolved.

Ruby fb_graph app_request, or Request Dialog

I'm trying to do an app request, but my requests do not apear in the notification (the globe icon) and I don't know what to do more.
Just to confirm that i've done everything ok, I have followed the JS SDK Request Dialog example:
http://developers.facebook.com/docs/reference/dialogs/requests/
At first time it seems to work ok, and I have a list of my request, but can't see none in facebook.
What I have done so far:
used the fb_graph gem ( https://github.com/nov/fb_graph )
u = FbGraph::User.me(User.find(2).fb_access_token)
u.app_request!(:message => 'punk message')
After that if I do u.app_requests, I can see a list of requests.
As this seems not to work I after tried the Facebook JS SDK, and the result is the same.
My Question is: What am I doing wrong, or missing something?
Thank you
The more I'm around it, the more I'm favoring the Javascript SDK over server side code. Is there a reason for your app to require to do anything serverside, or can you accomplish the same thing client side? Can you give us an example of the Javascript code you tried that failed?

Resources