Skip to main content
POST
/
wan
/
{site_id}
/
tunnel
/
gateways
Look up Eligible Gateways
curl --request POST \
  --url https://v1.api.altostrat.io/wan/{site_id}/tunnel/gateways \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "interface": "ether1-wan"
}
'
import requests

url = "https://v1.api.altostrat.io/wan/{site_id}/tunnel/gateways"

payload = { "interface": "ether1-wan" }
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({interface: 'ether1-wan'})
};

fetch('https://v1.api.altostrat.io/wan/{site_id}/tunnel/gateways', 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/wan/{site_id}/tunnel/gateways",
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([
'interface' => 'ether1-wan'
]),
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/wan/{site_id}/tunnel/gateways"

payload := strings.NewReader("{\n \"interface\": \"ether1-wan\"\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/wan/{site_id}/tunnel/gateways")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interface\": \"ether1-wan\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/wan/{site_id}/tunnel/gateways")

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 \"interface\": \"ether1-wan\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "gateway": "198.51.100.1",
    "is_dhcp": false
  }
]
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}

Authorizations

Authorization
string
header
required

Enter your JWT in the format: Bearer

Path Parameters

site_id
string<uuid>
required

The unique identifier for the site.

Example:

"9c69345c-8d39-4786-9f17-8153c988c89a"

Body

application/json
interface
string
required

The name of the interface on the router to query.

Example:

"ether1-wan"

Response

A list of potential gateway IP addresses for the interface.

gateway
string<ipv4>

A potential gateway IP address.

Example:

"198.51.100.1"

is_dhcp
boolean

Indicates if the gateway is likely assigned via DHCP.

Example:

false