Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Null response for name and email entities

I tried inbuilt variable "user" methods, $user.name and $user.email in text response of API.AI, to greet user and show email-Id. Is there any inbuilt variable name user?

Example(User sign-up with Gmail),

Response-Code, I had tried in API.AI's text-response dialog box:
Hi, $user.firstname
This is your $user.email

Expected:
User: Hi!
My-Assistant-App: Hi, Varun.
User: Show my email-id
My-Assistant-App: This is your ******@gmail.com

Output, I am getting in the My-Assistant-App:
User: Hi!
My-Assistant-app: Hi, $user.firstname 
User: Show my email-id
My-Assistant-App: This is your $user.email
like image 654
kvk30 Avatar asked Jan 30 '23 16:01

kvk30


2 Answers

There is no built in parameter user.

Even if there was such a built-in parameter, it wouldn't expose the email address automatically (and probably not the name, either).

Since you are using Actions on Google, you can use it to get user information such as the user's name, but this will require using Fulfillment through a webservice. See How to fetch device location using API AI? for more information about this (name and location are two things you can request permission for).

The email address, however, is not something you can request in this way. To do this, you'll probably have to go through account linking to link it to a Google identity. See How to authenticate user with just a Google account on Actions on Google? for further info as well.

like image 79
Prisoner Avatar answered Feb 08 '23 13:02

Prisoner


There is no built-in variable 'user'.
If you want such functionality, then you need to enable account linking. Use the access_token returned and use it to fetch name, email or anything.

like image 33
J Shubham Avatar answered Feb 08 '23 13:02

J Shubham