How do I get the user's email address using the Gmail API?

962 views Asked by At

I'm trying to do what's described here: https://developers.google.com/gmail/api/v1/reference/users/getProfile

So far I'm able to send the authorization request to the user, get the code, then exchange it with for the access token. HOW DO I USE THE ACCESS TOKEN TO GET THE EMAIL ADDRESS?

I need it to login IMAP using OAuth2, wich requires the user give his e-mail, which seems redundant to me.

1

There are 1 answers

0
db-user On

you have to add the "access_token" parameter and enable the Gmail API in the project page on the Developer Console