GitHub API 提供了一种获取组织成员的方式。我是我的组织的管理员/所有者,我想获取所有用户的电子邮件地址。我尝试使用
使用我的管理员
我得到的回复看起来像这样(对于其中一个用户):
奇怪的是,这里包含了关于用户的大量信息,但却没有用户的重要信息之一,即电子邮件地址。作为管理员,我应该能够获取所有用户的电子邮件地址。
另一个user API只返回我的自己的电子邮件地址,也就是在请求中使用的帐户的电子邮件地址。API用法:
members
API,但它不返回电子邮件地址。使用我的管理员
auth-token
和 curl: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"
奇怪的是,这里包含了关于用户的大量信息,但却没有用户的重要信息之一,即电子邮件地址。作为管理员,我应该能够获取所有用户的电子邮件地址。
另一个user API只返回我的自己的电子邮件地址,也就是在请求中使用的帐户的电子邮件地址。API用法:
GET /user/emails
这个怎么实现呢?有没有其他方法可以绕过它?