0

使用Octokit,我可以遍历链接rels以访问“组织”和“成员”,但我似乎无法在任何地方找到“团队”。

我可以获得一个组织的代表,但该链接rels不包含团队的任何内容

curl -H "Authorization: token $OAUTHTOKEN" https://api.github.com/orgs/MY_ORG

给我

{ "login": "…", "id": …, "url": "https://api.github.com/orgs/MY_ORG", "repos_url": "https://api.github.com/orgs/MY_ORG/repos", "events_url": "https://api.github.com/orgs/MY_ORG/events", "members_url": "https://api.github.com/orgs/MY_ORG/members{/member}", "public_members_url": "https://api.github.com/orgs/MY_ORG/public_members{/member}" … }

Octokit 获得了类似的结果:

client = Octokit::Client.new access_token: ENV['GITHUB_ACCESS_TOKEN'] my_org = client.org 'MY_ORG' my_org.rels {:self_url=>"https://api.github.com/orgs/MY_ORG", :repos_url=>"https://api.github.com/orgs/MY_ORG/repos", :events_url=>"https://api.github.com/orgs/MY_ORG/events", :members_url=>"https://api.github.com/orgs/MY_ORG/members", :public_members_url=>"https://api.github.com/orgs/MY_ORG/public_members", :avatar_url=>"…", :html_url=>"https://github.com/MY_ORG"}

4

1 回答 1

0

如果您阅读组织的开发人员文档,您会看到端点是. 获得你想要的个人团队。/orgs/:org_name/teams/teams/:team_id


我现在看到您正在使用 OAuth 令牌(来自授权 API)。您可能没有为令牌设置适当的范围。查看范围列表并注意您可能至少不想read:org看到您的团队。

于 2014-07-22T02:00:06.737 回答