xo-orderbook-client-rs
// Requires an authenticated client.
let resp = client.api_keys().await?;
for uuid in &resp.api_keys {
println!("key: {uuid}");
}
curl --request GET \
--url https://orderbooks.xo.market/auth/api-keys \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/auth/api-keys"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/auth/api-keys', 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://orderbooks.xo.market/auth/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <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://orderbooks.xo.market/auth/api-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<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://orderbooks.xo.market/auth/api-keys")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/auth/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiKeys": [
"7a3f9c1d-8b2e-4a5c-9d1e-2f3a4b5c6d7e"
]
}
Authentication
List API keys
List the caller’s API key UUIDs. Owner is derived from the
presented HMAC API key — there is no ?address= query
parameter (closes a credential-enumeration hole).
GET
/
auth
/
api-keys
xo-orderbook-client-rs
// Requires an authenticated client.
let resp = client.api_keys().await?;
for uuid in &resp.api_keys {
println!("key: {uuid}");
}
curl --request GET \
--url https://orderbooks.xo.market/auth/api-keys \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/auth/api-keys"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/auth/api-keys', 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://orderbooks.xo.market/auth/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <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://orderbooks.xo.market/auth/api-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<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://orderbooks.xo.market/auth/api-keys")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/auth/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiKeys": [
"7a3f9c1d-8b2e-4a5c-9d1e-2f3a4b5c6d7e"
]
}
Authorizations
L2 HMAC request signature. See Authentication.
Response
OK