Poll for an approved CLI session
curl --request POST \
--url https://api.video2ctx.dev/api/auth/device/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "<string>",
"client_id": "video2ctx-cli"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
device_code: '<string>',
client_id: 'video2ctx-cli'
})
};
fetch('https://api.video2ctx.dev/api/auth/device/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.video2ctx.dev/api/auth/device/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "<string>",
"client_id": "video2ctx-cli"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token_type": "Bearer",
"expires_in": 2,
"scope": "data:read account:access"
}{
"error": {
"code": "QUERY_REQUIRED",
"message": "<string>",
"details": "<unknown>",
"requestId": "<string>"
}
}{
"error": {
"code": "QUERY_REQUIRED",
"message": "<string>",
"details": "<unknown>",
"requestId": "<string>"
}
}Authentication
Poll for an approved CLI session
Exchanges an approved device code for a revocable bearer session. Honor the issued polling interval and terminal OAuth device-flow errors.
POST
/
api
/
auth
/
device
/
token
Poll for an approved CLI session
curl --request POST \
--url https://api.video2ctx.dev/api/auth/device/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "<string>",
"client_id": "video2ctx-cli"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
device_code: '<string>',
client_id: 'video2ctx-cli'
})
};
fetch('https://api.video2ctx.dev/api/auth/device/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.video2ctx.dev/api/auth/device/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "<string>",
"client_id": "video2ctx-cli"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token_type": "Bearer",
"expires_in": 2,
"scope": "data:read account:access"
}{
"error": {
"code": "QUERY_REQUIRED",
"message": "<string>",
"details": "<unknown>",
"requestId": "<string>"
}
}{
"error": {
"code": "QUERY_REQUIRED",
"message": "<string>",
"details": "<unknown>",
"requestId": "<string>"
}
}Body
application/json