Get all email addresses of user using Google API

前端 未结 4 1863
醉酒成梦
醉酒成梦 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:33

    It has been a while since the question was asked. You can use the Google People API to get a user's primary email address and aliases. Here's the documentation. The scope you need to use is: https://www.googleapis.com/auth/user.addresses.read

    This will return all the email addresses for the user and also tell you which is the primary one.

提交回复
热议问题