cURL
curl --request GET \
--url https://cmd.illusory.io/v1/stock \
--header 'Authorization: Bearer <token>'import requests
url = "https://cmd.illusory.io/v1/stock"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cmd.illusory.io/v1/stock', 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://cmd.illusory.io/v1/stock",
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>"
],
]);
$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://cmd.illusory.io/v1/stock"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cmd.illusory.io/v1/stock")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cmd.illusory.io/v1/stock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"message": "Retrieved stock successfully.",
"data": [
{
"city": "Austin",
"state": "TX",
"att": 0,
"verizon": 39,
"tmobile": 0,
"status": "available",
"open": true,
"visible": true
},
{
"city": "Cleveland",
"state": "OH",
"att": 0,
"verizon": 1,
"tmobile": 0,
"status": "available",
"open": true,
"visible": true
},
{
"city": "Los Angeles",
"state": "CA",
"att": 0,
"verizon": 0,
"tmobile": 0,
"status": "out",
"open": true,
"visible": true
},
{
"city": "New York",
"state": "NY",
"att": 0,
"verizon": 0,
"tmobile": 0,
"status": "coming",
"open": false,
"visible": true
}
]
}{
"ok": false,
"data": {},
"message": "Error checking stock."
}Platform
Get Stock
Retrieves the Illusory product stock.
GET
/
v1
/
stock
cURL
curl --request GET \
--url https://cmd.illusory.io/v1/stock \
--header 'Authorization: Bearer <token>'import requests
url = "https://cmd.illusory.io/v1/stock"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cmd.illusory.io/v1/stock', 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://cmd.illusory.io/v1/stock",
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>"
],
]);
$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://cmd.illusory.io/v1/stock"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cmd.illusory.io/v1/stock")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cmd.illusory.io/v1/stock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"message": "Retrieved stock successfully.",
"data": [
{
"city": "Austin",
"state": "TX",
"att": 0,
"verizon": 39,
"tmobile": 0,
"status": "available",
"open": true,
"visible": true
},
{
"city": "Cleveland",
"state": "OH",
"att": 0,
"verizon": 1,
"tmobile": 0,
"status": "available",
"open": true,
"visible": true
},
{
"city": "Los Angeles",
"state": "CA",
"att": 0,
"verizon": 0,
"tmobile": 0,
"status": "out",
"open": true,
"visible": true
},
{
"city": "New York",
"state": "NY",
"att": 0,
"verizon": 0,
"tmobile": 0,
"status": "coming",
"open": false,
"visible": true
}
]
}{
"ok": false,
"data": {},
"message": "Error checking stock."
}Authorizations
The Authorization header is used to authenticate with the API using your Master API key. Value is of the format Bearer YOUR_KEY_HERE.
Was this page helpful?
⌘I