使用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"}