Where an action request stands
curl --request GET \
--url https://api.botshield.ai/operations/gates-api/actions/request-status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.botshield.ai/operations/gates-api/actions/request-status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.botshield.ai/operations/gates-api/actions/request-status', 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.botshield.ai/operations/gates-api/actions/request-status",
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://api.botshield.ai/operations/gates-api/actions/request-status"
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://api.botshield.ai/operations/gates-api/actions/request-status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botshield.ai/operations/gates-api/actions/request-status")
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{
"data": {
"data": {
"request_id": "<string>",
"status": "queued",
"act": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"token": "<string>",
"token_expires_in": 123
},
"error": {
"message": "<string>",
"statusCode": 409,
"code": "gate_key_taken"
}
}
}{
"message": "Invalid input provided",
"input": {},
"errors": [
{
"propertyPath": "<string>",
"invalidValue": "<unknown>",
"message": "<string>"
}
]
}{
"error": {
"message": "<string>",
"statusCode": 123
}
}Gates API
Where an action request stands
Status of a request from gates-api/actions/request. wait_seconds (≤ 25) holds the call until the status changes. Once approved, token is the action token (claims.act) for token_expires_in seconds — check it with sdk/verify-token; it works once. After the collection window (10 minutes from the approval) the status stays approved with token: null.
GET
/
gates-api
/
actions
/
request-status
Where an action request stands
curl --request GET \
--url https://api.botshield.ai/operations/gates-api/actions/request-status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.botshield.ai/operations/gates-api/actions/request-status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.botshield.ai/operations/gates-api/actions/request-status', 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.botshield.ai/operations/gates-api/actions/request-status",
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://api.botshield.ai/operations/gates-api/actions/request-status"
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://api.botshield.ai/operations/gates-api/actions/request-status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botshield.ai/operations/gates-api/actions/request-status")
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{
"data": {
"data": {
"request_id": "<string>",
"status": "queued",
"act": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"token": "<string>",
"token_expires_in": 123
},
"error": {
"message": "<string>",
"statusCode": 409,
"code": "gate_key_taken"
}
}
}{
"message": "Invalid input provided",
"input": {},
"errors": [
{
"propertyPath": "<string>",
"invalidValue": "<unknown>",
"message": "<string>"
}
]
}{
"error": {
"message": "<string>",
"statusCode": 123
}
}Authorizations
Your secret server API key (bs_dev_… or bs_production_…) with Gates API access: the gates:write scope, granted in the Console under Settings → Developer Tools → API Keys. Without it every Gates API call answers gates_scope_required. The organization and environment always come from the key. Site keys are refused.
