Device Code Authorization flow
To obtain Access tokens for authenticating to API v3 (/api/3/) APImetrics Endpoints, follow these steps:
1. Obtain a Device Code
- Make a POST request to the
/oauth/device/codeendpoint, providing yourClient_id,Scope, andaudienceparameters as shown below.- URL:
https://auth.apimetrics.io/oauth/device/code - Headers:
- Content-Type :
application/x-www-form-urlencoded
- Content-Type :
- Body Parameters:
- client_id : [string]
- scope : [array]
- audience:
https://client.apimetrics.io
- URL:
- The Response will contain a
Device codeand aVerification URI Complete.
Check with your organization Admin for your Organization'sClient Id
2. Redirect the User
- Direct the user to the
verification_uri_completelink.
3. Obtain User's Consent
- The user will be prompted to grant the application permission to access their data.
4. Exchange Device Code for Access Token
- Make a POST request to
/oauth/tokenendpoint, providing theDevice codeandClient Idparameters as shown below:- URL:
https://auth.apimetrics.io/oauth/token - Headers:
- Content-Type :
application/x-www-form-urlencoded
- Content-Type :
- Body Parameters:
- grant_type :
urn:ietf:params:oauth:grant-type:device_code - device_code : [string]
- client_id : [string]
- grant_type :
- URL:
- The Response contains an
Access Tokenand anID Token
Once you have an Access Token, you can use it to authenticate your API v3 requests by including it in the Authorization header:Authorization: Bearer<Access_Token>
Updated about 2 months ago