Request Access Token

Changed on

Exchange a device_code for an access token once the user approves the request.

post/oauth/token

Request

  • Base URL
    https://api.dashboard.knotapi.com
  • URL
    https://api.dashboard.knotapi.com/oauth/token
  • Auth
    none required

Request body application/x-www-form-urlencoded

grant_type'urn:ietf:params:oauth:grant-type:device_code' required

The grant type. Must be urn:ietf:params:oauth:grant-type:device_code.

client_idstring required

The same client ID you sent to Request Device Code.

device_codestring required

The device_code from Request Device Code.

Example request

{
  "grant_type": "urn:ietf:params:oauth:grant-type:device_code",
  "client_id": "9f3c2a1e-6b7d-4e8f-a2c4-5d6e7f8a9b0c",
  "device_code": "def50200a1b2c3d4e5f6"
}

Response

Successful request.

token_typestring

Always Bearer.

expires_ininteger

Seconds until the access token expires.

access_tokenstring

Access token to send as a Bearer token.

Example response

{
  "token_type": "Bearer",
  "expires_in": 900,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5ZjNjMmExZSJ9.c2lnbmF0dXJl"
}

Changes