soniya.rayabagi
Fri Apr 05 2024
Today I learnt , REST API endpoints for organization members
• It will List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
• The token must have the following permission set: members:read
• Request example:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
<https://api.github.com/orgs/ORG/members>
Response
[
{
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "<https://github.com/images/error/octocat_happy.gif>",
"gravatar_id": "",
"url": "<https://api.github.com/users/octocat>",
"html_url": "<https://github.com/octocat>",
"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}>",
"starred_url": "<https://api.github.com/users/octocat/starred{/owner}{/repo}>",
"subscriptions_url": "<https://api.github.com/users/octocat/subscriptions>",
"organizations_url": "<https://api.github.com/users/octocat/orgs>",
"repos_url": "<https://api.github.com/users/octocat/repos>",
"events_url": "<https://api.github.com/users/octocat/events{/privacy}>",
"received_events_url": "<https://api.github.com/users/octocat/received_events>",
"type": "User",
"site_admin": false
}
]
#githubactionspublic #rest api