Polling for Device Authorization

Once we have handed the pairing code to the user, we need to check and see if they've entered it. To do so, we can make the following request.

Request
header Parameters
x-client-version
string
Default: 0.0.0

Firmware or software version of a C2C integration. Will be used to determine the correct Device Model configuration for the device when multiple are available. Must be a valid semantic version. For more on semantic versions, see here: https://semver.org/

Example: 2.16.4
Request Body schema: multipart/form-data
grant_type
required
string

The type of authorization grant our OAuth system is issuing.

Value: "urn:ietf:params:oauth:grant-type:device_code"
client_id
required
string

The unique device id, such as the device serial number. Must be the same as the client id used on the initiation request.

device_code
required
string

The unique device_code generated by the server for this authorization attempt. Returned from the initiation request.

Responses
200
Response Schema: application/json
access_token
required
string

This is your key to the rest of the Frame.io backend. We will need to add this to the header of the rest of the requests we are going to make in these tutorials.

expires_in
required
number

The number of seconds until access_token expires. After the token's time is up, it will need to be refreshed, which we will go over in a future tutorial.

refresh_token
required
string <uuid>

A token we can use to manage our access_token. It will most commonly be used to refresh our authorization, but it can also be used to revoke it.

token_type
required
string

Will always be bearer for the C2C API, and is not actionable.

Value: "bearer"
400

Bad request

get/v2/auth/token
Request samples
Response samples
application/json
{
  • "access_token": "string",
  • "expires_in": 0,
  • "refresh_token": "120c200e-32b3-497f-b267-07b30cc24052",
  • "token_type": "bearer"
}