Get all email addresses of user using Google API

前端 未结 4 1866
醉酒成梦
醉酒成梦 2021-02-15 12:13

For my own gmail account, I have multiple email addresses associated with it. For example, I have an email address from my university that is associated with my gmail, and I ca

4条回答
  •  梦如初夏
    2021-02-15 12:43

    This is possible. However, this has changed since Google announced the deprecation of their Google+ People API, which a lot of folks used to get all the email addresses for a user. The current most voted answer now goes to a 404.

    Google Plus People API Replacement

    Google has replaced the Google Plus People API /plus/v1/people/me with https://developers.google.com/people/ and you’ll want to use the https://www.googleapis.com/auth/user.emails.read profile scope as discussed here as a replacement. The schema is different, so you'll need to change your mapping as well.

    If your app already used the following scopes from the old /plus/v1/people/me your user will not have to re-consent when you switch to the new API:

    email
    profile
    https://www.googleapis.com/auth/plus.login
    https://www.googleapis.com/auth/plus.me
    https://www.googleapis.com/auth/plus.profile.agerange.read
    https://www.googleapis.com/auth/plus.profile.emails.read
    https://www.googleapis.com/auth/plus.profile.language.read
    

提交回复
热议问题