Skip to content

Get an access token

Before it calls the BIOS API, a client exchanges its client ID and secret for an access token, with the OAuth 2.0 client credentials grant. audience identifies the BIOS API.

BIOS will provide the client ID and secret as part of the onboarding process.

ACCESS_TOKEN=$(curl -s -X POST https://auth.biosgenomics.com/oauth/token \
  -d grant_type=client_credentials \
  -d client_id="$CLIENT_ID" \
  -d client_secret="$CLIENT_SECRET" \
  -d audience=https://sandbox.biosgenomics.com \
  | jq -r .access_token)

The token endpoint returns the JSON shown below. In the example above, jq stores its access_token in ACCESS_TOKEN, which other examples in this documentation use (see Create a case for example).

{
  "access_token": "eyJhbGciOi...",
  "token_type": "Bearer",
  "expires_in": 86400
}