Get all email addresses of user using Google API

前端 未结 4 1741
粉色の甜心
粉色の甜心 2021-02-15 12:20

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:36

    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.

提交回复
热议问题