curl --location --request GET 'https://api.github.com/user/memberships/orgs'
[
{
"organization": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"id": 1,
"issues_url": "https://api.github.com/orgs/github/issues",
"login": "github",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"repos_url": "https://api.github.com/orgs/github/repos",
"url": "https://api.github.com/orgs/github"
},
"organization_url": "https://api.github.com/orgs/octocat",
"permissions": {
"can_create_repository": true
},
"role": "admin",
"state": "active",
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"user": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
}
}
]
Authorization: Bearer ********************
active
or pending
. If not specified, the API returns both active and pending memberships.pending
state indicates the user has not yet accepted an invitation.【GitHub】API开发者 微信交流群
用微信扫右侧二维码,加入【GitHub】API开发者 交流群,互助沟通