我很困惑为什么我的卷曲:curl https://api.github.com/orgs/:org/members
只返回一个长度为5的数组,当组织中有超过50人时?
当我执行curl https://api.github.com/orgs/:org/members?page=2
时,它只返回[ ]
,表示没有更多?
这个人和成员的概念是不同于网站的api?
或者我需要做一些不同的事情才能获得所有成员吗?
答案 0 :(得分:0)
If the authenticated user is also a member of this organization then both concealed and public members will be returned.
因此,您可能需要进行身份验证才能列出组织中的所有用户。
您可以通过添加-u
选项来完成此操作:
curl -u "username:password" https://api.github.com/orgs/:org/members
一般情况下,我建议在脚本中使用OAuth2令牌而不是Basic Auth。您可以阅读支持的身份验证方案here。