curl --request POST \
--url https://perps-api.vooi.io/user/tokens \
--header 'Content-Type: application/json' \
--data '
{
"signature": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"timestamp": 0,
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 0,
"name": "<string>"
}
'import requests
url = "https://perps-api.vooi.io/user/tokens"
payload = {
"signature": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"timestamp": 0,
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 0,
"name": "<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({
signature: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2',
timestamp: 0,
userId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expiresIn: 0,
name: '<string>'
})
};
fetch('https://perps-api.vooi.io/user/tokens', 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://perps-api.vooi.io/user/tokens",
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([
'signature' => 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2',
'timestamp' => 0,
'userId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expiresIn' => 0,
'name' => '<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://perps-api.vooi.io/user/tokens"
payload := strings.NewReader("{\n \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<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://perps-api.vooi.io/user/tokens")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://perps-api.vooi.io/user/tokens")
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 \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"expiresAt": "2023-12-25",
"id": "<string>",
"token": "<string>"
}Create a new API token
curl --request POST \
--url https://perps-api.vooi.io/user/tokens \
--header 'Content-Type: application/json' \
--data '
{
"signature": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"timestamp": 0,
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 0,
"name": "<string>"
}
'import requests
url = "https://perps-api.vooi.io/user/tokens"
payload = {
"signature": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
"timestamp": 0,
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 0,
"name": "<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({
signature: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2',
timestamp: 0,
userId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expiresIn: 0,
name: '<string>'
})
};
fetch('https://perps-api.vooi.io/user/tokens', 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://perps-api.vooi.io/user/tokens",
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([
'signature' => 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2',
'timestamp' => 0,
'userId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expiresIn' => 0,
'name' => '<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://perps-api.vooi.io/user/tokens"
payload := strings.NewReader("{\n \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<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://perps-api.vooi.io/user/tokens")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://perps-api.vooi.io/user/tokens")
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 \"signature\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\",\n \"timestamp\": 0,\n \"userId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expiresIn\": 0,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"expiresAt": "2023-12-25",
"id": "<string>",
"token": "<string>"
}Body
Ed25519 signature of the token creation request.
Message: createToken:<timestamp>:<expiresIn>:<name>:<userId> — data fields sorted alphabetically by key. Omitted optional fields become an empty slot (not a dropped slot):
- name omitted →
createToken:<ts>:<expiresIn>::<userId> - expiresIn omitted →
createToken:<ts>::<name>:<userId> - both omitted →
createToken:<ts>:::<userId>
Sign the UTF-8 bytes of the message with the Ed25519 private key whose public key is registered for the user. Encode the signature as lowercase hex, 128 chars, no 0x prefix.
^[0-9a-f]{128}$"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
Unix timestamp in milliseconds. Must be within ±2 minutes of server time or the request is rejected with 401 Signature expired.
-9007199254740991 <= x <= 9007199254740991User identifier. Send the value verbatim — do not re-case it, since the signed message must match byte-for-byte.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Token lifetime in seconds. Defaults to 604800 (7 days). Must be > 0. When > 604800, name is required.
-9007199254740991 <= x <= 9007199254740991Token name. Required when expiresIn > 604800 (7 days). Must be unique per user. Tokens without a name are session tokens and are not enumerable.
Response
Token expiration date
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$Token ID
Bearer token value