CHETHAN S
CHETHAN S

Reputation: 21

Dialogflow getting username from Gmail account in inline editor

I have a Dialogflow inline, where when welcome intent is executed I need to call agent.add() so it replies with something like

Hello (username)!

This username is not that the user writes but it's the profile name that he has logged in to the device

Upvotes: 0

Views: 85

Answers (1)

Prisoner
Prisoner

Reputation: 50701

In order to get the user's name, you need to request permission from the user. So it usually isn't available as part of the welcoming Intent (at least not the first time they talk to your Action). You need to do one of two things:

  • Request user information which includes the user name. Once you have requested this information, you can save it so you'll get it the next time the user connects.
  • Ask the user to sign in. Once they have done so, you'll get an identity token with each request that includes the user's information

Upvotes: 1

Related Questions