Skip to content

Instantly share code, notes, and snippets.

@dillonstreator
Created January 5, 2022 17:34
Show Gist options
  • Save dillonstreator/279ac40ce1a365b395559bec8575dc7b to your computer and use it in GitHub Desktop.
Save dillonstreator/279ac40ce1a365b395559bec8575dc7b to your computer and use it in GitHub Desktop.
athenahealth get bearer token from ATHENA_CLIENT_ID and ATHENA_SECRET zsh command
athena-bearer() {
curl -H "Authorization: Basic $(echo -n "${ATHENA_CLIENT_ID}:${ATHENA_SECRET}" | base64)" -H 'Content-Type: application/x-www-form-urlencoded' -d "grant_type=client_credentials&scope=athena/service/Athenanet.MDP.*" "${ATHENA_BASE_URL}/oauth2/v1/token"
}
@dillonstreator
Copy link
Author

ATHENA_BASE_URL=https://api.preview.platform.athenahealth.com ATHENA_CLIENT_ID=123 ATHENA_SECRET=123 athena-bearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment