Run a synchronous RouterOS command
curl --request POST \
--url https://v1.api.altostrat.io/api/synchronous/{siteId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"command": "/ip/arp/print",
"parameters": []
}
'import requests
url = "https://v1.api.altostrat.io/api/synchronous/{siteId}"
payload = {
"command": "/ip/arp/print",
"parameters": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({command: '/ip/arp/print', parameters: []})
};
fetch('https://v1.api.altostrat.io/api/synchronous/{siteId}', 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://v1.api.altostrat.io/api/synchronous/{siteId}",
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([
'command' => '/ip/arp/print',
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://v1.api.altostrat.io/api/synchronous/{siteId}"
payload := strings.NewReader("{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v1.api.altostrat.io/api/synchronous/{siteId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/api/synchronous/{siteId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": "<unknown>"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Developer API
Run a synchronous RouterOS command
Runs a RouterOS command against a managed site and returns the router response. Use synchronous commands for reads or short diagnostics, not long-running configuration changes.
POST
/
api
/
synchronous
/
{siteId}
Run a synchronous RouterOS command
curl --request POST \
--url https://v1.api.altostrat.io/api/synchronous/{siteId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"command": "/ip/arp/print",
"parameters": []
}
'import requests
url = "https://v1.api.altostrat.io/api/synchronous/{siteId}"
payload = {
"command": "/ip/arp/print",
"parameters": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({command: '/ip/arp/print', parameters: []})
};
fetch('https://v1.api.altostrat.io/api/synchronous/{siteId}', 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://v1.api.altostrat.io/api/synchronous/{siteId}",
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([
'command' => '/ip/arp/print',
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://v1.api.altostrat.io/api/synchronous/{siteId}"
payload := strings.NewReader("{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v1.api.altostrat.io/api/synchronous/{siteId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/api/synchronous/{siteId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \"/ip/arp/print\",\n \"parameters\": []\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": "<unknown>"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'lat' parameter must be between -90 and 90.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Authorizations
Authenticate requests by providing a JSON Web Token (JWT) in the Authorization header. Example: Authorization: Bearer <YOUR_JWT>
Path Parameters
The target site/router UUID.
Example:
"9c69345c-8d39-4786-9f17-8153c988c89a"
Body
application/json
Was this page helpful?
⌘I