Device Info
curl --request GET \
--url https://api.hyperspell.com/auth/device-info/{device_code} \
--header 'Authorization: Bearer <token>' \
--header 'X-As-User: <api-key>'import requests
url = "https://api.hyperspell.com/auth/device-info/{device_code}"
headers = {
"Authorization": "Bearer <token>",
"X-As-User": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'X-As-User': '<api-key>'}
};
fetch('https://api.hyperspell.com/auth/device-info/{device_code}', 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.hyperspell.com/auth/device-info/{device_code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-As-User: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperspell.com/auth/device-info/{device_code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-As-User", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperspell.com/auth/device-info/{device_code}")
.header("Authorization", "Bearer <token>")
.header("X-As-User", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/auth/device-info/{device_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-As-User"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"app_slug": "<string>",
"status": "<string>",
"device_name": "<string>",
"requester_name": "<string>",
"initiator_ip": "<string>",
"initiator_user_agent": "<string>",
"admin_requested": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Device Auth
Device Info
Look up a device code to show the approval UI.
GET
/
auth
/
device-info
/
{device_code}
Device Info
curl --request GET \
--url https://api.hyperspell.com/auth/device-info/{device_code} \
--header 'Authorization: Bearer <token>' \
--header 'X-As-User: <api-key>'import requests
url = "https://api.hyperspell.com/auth/device-info/{device_code}"
headers = {
"Authorization": "Bearer <token>",
"X-As-User": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'X-As-User': '<api-key>'}
};
fetch('https://api.hyperspell.com/auth/device-info/{device_code}', 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.hyperspell.com/auth/device-info/{device_code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-As-User: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperspell.com/auth/device-info/{device_code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-As-User", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperspell.com/auth/device-info/{device_code}")
.header("Authorization", "Bearer <token>")
.header("X-As-User", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/auth/device-info/{device_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-As-User"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"app_slug": "<string>",
"status": "<string>",
"device_name": "<string>",
"requester_name": "<string>",
"initiator_ip": "<string>",
"initiator_user_agent": "<string>",
"admin_requested": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token
Path Parameters
Was this page helpful?
⌘I