Authentication
How To Get An Access Token
To access the Myriad Order API using 2-legged OAuth 2.0, you will need to follow a specific set of steps. Two-legged OAuth, also known as client credentials grant, allows your application to obtain an access token directly without user involvement. Here's a step-by-step guide to get an access token for the Myriad Order API:
- Prerequisite:
- You will need a "Client ID", "Client Secret" and “Scope” provided by Myriad Genetics. These credentials will be used to authenticate your application.
- Get an Access Token Using cURL:
You can use cURL (a command-line tool) to make an HTTP POST request to Myriad's token endpoint to obtain an access token. Replace the placeholders ({clientId}
and {clientSecret}
) with your specific information.
curl -X POST "https://myriad.okta.com/oauth2/ausqm6yrog9OXpHL7356/v1/token" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id={clientId}" \
-d "client_secret={clientSecret}" \
-d "scope=device"
{clientId}
: Replace this with your Myriad application's Client ID.{clientSecret}
: Replace this with your Myriad application's Client Secret.
- Parse the Response:
When you run the cURL command, you'll receive a JSON response that includes the access token. Parse this response in your application to extract the access token.
Sample response:
{
"access_token": "your_access_token",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "device"
}
- "access_token": This is the access token you can use to access the Myriad Order API.
- "expires_in": Indicates the expiration time of the token (in seconds).