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/code
endpoint, providing yourClient_id
,Scope
, andaudience
parameters 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 code
and aVerification URI Complete
.
Check with your organization Admin for your Organization's
Client Id
2. Redirect the User
- Direct the user to the
verification_uri_complete
link.
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/token
endpoint, providing theDevice code
andClient Id
parameters 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 Token
and 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 3 months ago