curl --request POST \
--url https://api.qumo-deploy.com/v1/auth/device/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n"
}
'import requests
url = "https://api.qumo-deploy.com/v1/auth/device/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
device_code: 'Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n'
})
};
fetch('https://api.qumo-deploy.com/v1/auth/device/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qumo-deploy.com/v1/auth/device/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'grant_type' => 'urn:ietf:params:oauth:grant-type:device_code',
'device_code' => 'Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.qumo-deploy.com/v1/auth/device/token"
payload := strings.NewReader("{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.qumo-deploy.com/v1/auth/device/token")
.header("Content-Type", "application/json")
.body("{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qumo-deploy.com/v1/auth/device/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "k3Rz8vQ1mN5pX7wL2cT9bY4hJ6sF0aD3gU8eI1oK5nM7rV2qZ9xW4tC6yB1jH8fS3dA0gE5uP7iL2kN9mR4vQ6zXw",
"token_type": "bearer",
"expires_in": 604800
}{
"error": "organization_id is required"
}Poll for the device sign-in token
Exchanges an approved device code for a CLI session token, which is
then sent as Authorization: Bearer <access_token> (the cliSession
scheme). Until the user approves, the response is 400 with error
set to authorization_pending; polling faster than interval gives
slow_down. Other error values are expired_token, access_denied,
invalid_grant (unknown or already used code), invalid_request and
unsupported_grant_type. Each code yields one token. Accepts JSON or
application/x-www-form-urlencoded.
curl --request POST \
--url https://api.qumo-deploy.com/v1/auth/device/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n"
}
'import requests
url = "https://api.qumo-deploy.com/v1/auth/device/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": "Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
device_code: 'Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n'
})
};
fetch('https://api.qumo-deploy.com/v1/auth/device/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qumo-deploy.com/v1/auth/device/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'grant_type' => 'urn:ietf:params:oauth:grant-type:device_code',
'device_code' => 'Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.qumo-deploy.com/v1/auth/device/token"
payload := strings.NewReader("{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.qumo-deploy.com/v1/auth/device/token")
.header("Content-Type", "application/json")
.body("{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qumo-deploy.com/v1/auth/device/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\",\n \"device_code\": \"Xq7vR2mK9pL4tN8wZ3cY6bH1jF5sD0aG2eU7iO4kM9n\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "k3Rz8vQ1mN5pX7wL2cT9bY4hJ6sF0aD3gU8eI1oK5nM7rV2qZ9xW4tC6yB1jH8fS3dA0gE5uP7iL2kN9mR4vQ6zXw",
"token_type": "bearer",
"expires_in": 604800
}{
"error": "organization_id is required"
}Body
Response
The user approved; here is the session token.
The CLI session token. Send it as Authorization: Bearer <access_token>.
"k3Rz8vQ1mN5pX7wL2cT9bY4hJ6sF0aD3gU8eI1oK5nM7rV2qZ9xW4tC6yB1jH8fS3dA0gE5uP7iL2kN9mR4vQ6zXw"
bearer "bearer"
Seconds until the session expires (7 days).
604800