Skip to content

Instantly share code, notes, and snippets.

@saiumesh535
Created February 2, 2022 05:08
Show Gist options
  • Save saiumesh535/c653a4ffaa0ec76852042fc1bf55ea70 to your computer and use it in GitHub Desktop.
Save saiumesh535/c653a4ffaa0ec76852042fc1bf55ea70 to your computer and use it in GitHub Desktop.
Get Users in your GitHub Organisation
const axios = require('axios');
async function getMembers() {
try {
const resp = await axios.default.get('https://api.github.com/orgs/<org_name>/members', {
headers: {
'Accept': "application/vnd.github.v3+json",
"Authorization": "Bearer <token>"
}
});
console.log(resp)
} catch (error) {
console.error(error.message);
}
}
getMembers();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment