curl
curl -X POST https://my_sql_node.com/v1/sso_device_grant \
-H "Content-Type: application/json" \
-d '{
"database": "retail_analytics"
}'import requests
url = "https://{sql_node}/v1/sso_device_grant"
payload = { "database": "<string>" }
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({database: '<string>'})
};
fetch('https://{sql_node}/v1/sso_device_grant', 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://{sql_node}/v1/sso_device_grant",
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([
'database' => '<string>'
]),
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://{sql_node}/v1/sso_device_grant"
payload := strings.NewReader("{\n \"database\": \"<string>\"\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://{sql_node}/v1/sso_device_grant")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/sso_device_grant")
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 \"database\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"verification_uri_complete": "https://auth.example.com/device?code=BCDFGHJK",
"verification_uri": "https://auth.example.com/device",
"user_code": "BCDFGHJK",
"status": {
"reason": "Device authorization initiated",
"sql_state": "00000",
"vendor_code": 0
}
}Ocient HTTP Query API
sso_device_grant
Retrieve an OpenID device grant code that the Ocient System can verify and use with the sso_device_grant_verify endpoint.
The device grant process is intended for devices with limited input capabilities or no web browser:
- Call this endpoint to retrieve a user code and verification URI.
- Display the user code and verification URI to the user.
- The user visits the verification URI on another device and enters the code.
- Call the sso_device_grant_verify endpoint to check if the user has completed verification.
POST
/
v1
/
sso_device_grant
curl
curl -X POST https://my_sql_node.com/v1/sso_device_grant \
-H "Content-Type: application/json" \
-d '{
"database": "retail_analytics"
}'import requests
url = "https://{sql_node}/v1/sso_device_grant"
payload = { "database": "<string>" }
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({database: '<string>'})
};
fetch('https://{sql_node}/v1/sso_device_grant', 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://{sql_node}/v1/sso_device_grant",
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([
'database' => '<string>'
]),
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://{sql_node}/v1/sso_device_grant"
payload := strings.NewReader("{\n \"database\": \"<string>\"\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://{sql_node}/v1/sso_device_grant")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/sso_device_grant")
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 \"database\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"verification_uri_complete": "https://auth.example.com/device?code=BCDFGHJK",
"verification_uri": "https://auth.example.com/device",
"user_code": "BCDFGHJK",
"status": {
"reason": "Device authorization initiated",
"sql_state": "00000",
"vendor_code": 0
}
}Body
application/json
Target database name. If you do not specify this parameter, the request defaults this value to system. This value represents the database where the user connects after completing the device grant process.
Last modified on July 8, 2026
Was this page helpful?

