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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With