So, I have managed to link google user account to my agent on API.AI as per this guide and found similar answer to this.
"Profile" and "Email" has been added as client scope.
Now, the assistant have been sending a userId and AccessToken to my fulfillment webhook, under originalRequest-> data-> inputs->user
Something like this:
"user":{
"accessToken":"TWWM**********************bgf",
"locale":"en-US",
"userId":"AKL*********************exlT"
}
So far my accesToken is always rendered invalid by Google.
If I check my token:
https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=TWWM**********************bgf
It renders as invalid
{
"error_description": "Invalid Value"
}
How do I get the basic user profile information such as First Name, Last Name and Email given the above accessToken and UserId?
Which GoogleApi end point should I invoke?