GitHub API提供了一种获取组织成员的方法。我是我的组织的管理员/所有者,我想获取所有用户的电子邮件地址。我尝试使用members
API,但它不返回电子邮件地址。
与我的管理员一起使用 curl auth-token
:
GET /orgs/my-org/members
我得到的响应看起来像这样(对于其中一位用户)
"login": "auny",
"id": some-number,
"avatar_url": "https://secure.gravatar.com/avatar/6579d09c459f1adad8a60463f47eadd3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
"gravatar_id": "6579d09c459f1adad8a60463f47eadd3",
"url": "https://api.github.com/users/auny",
"html_url": "https://github.com/auny",
"followers_url": "https://api.github.com/users/auny/followers",
"following_url": "https://api.github.com/users/auny/following{/other_user}",
"gists_url": "https://api.github.com/users/auny/gists{/gist_id}",
"starred_url": "https://api.github.com/users/auny/starred{/owner}
{/repo}",
"subscriptions_url": "https://api.github.com/users/auny/subscriptions",
"organizations_url": "https://api.github.com/users/auny/orgs",
"repos_url": "https://api.github.com/users/auny/repos",
"events_url": "https://api.github.com/users/auny/events{/privacy}",
"received_events_url":
"https://api.github.com/users/auny/received_events",
"type": "User"
奇怪的是,这包含大量有关用户的信息,但其中不包含重要信息之一,即用户的电子邮件地址。作为admin
我应该能够获得我所有用户的电子邮件地址。
其他用户 API仅返回我自己的电子邮件地址,即auth-token
请求中使用的帐户的电子邮件地址。API使用:
GET /user/emails
如何做到这一点?有办法解决吗?