Skip to content

Instantly share code, notes, and snippets.

@bolerap
Created November 8, 2016 07:56
Show Gist options
  • Save bolerap/f157f76789ce1f08535881e9cc537a6b to your computer and use it in GitHub Desktop.
Save bolerap/f157f76789ce1f08535881e9cc537a6b to your computer and use it in GitHub Desktop.
# Send GET request to github api to get OAuth token.
curl --user "<username>" --data '{"scopes": ["gist"], "note": "Demo Oauth token"}' https://api.github.com/authorizations
# Use OAuth token to access resource
curl https://api.github.com/gitsts/starred?access_token=<token_string>
# or use OAuth token on request header
curl --header "Authorization: token <token_string>" https://api.github.com/gists/starred
# List all authorizations
curl --user "<username>" https://api.github.com/authorizations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment