Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.elasticIps.getElasticIpBgpSession({
elasticIpId: "ueip_e8pKq015DWAob",
id: "bgps_w49QDB9PqagKb",
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ElasticIps.GetElasticIPBgpSession(ctx, "ueip_e8pKq015DWAob", "bgps_w49QDB9PqagKb")
if err != nil {
log.Fatal(err)
}
if res.BgpSession != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}', 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.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "bgps_w49QDB9PqagKb",
"type": "bgp_sessions",
"attributes": {
"status": "active",
"status_message": null,
"server_ip": "162.43.189.161",
"asn": 65001,
"created_at": "2026-07-24T10:00:00Z",
"server": {
"id": "sv_A05EdQp4OvKYQ",
"hostname": "para-bgp-3",
"primary_ipv4": "162.43.189.161",
"operating_system": "ubuntu_24_04_x64_lts"
},
"region": {
"id": "reg_qOxWMz15VGAwd",
"name": "United States",
"location": {
"id": "loc_Yb7VpP53OjxEr",
"name": "Los Angeles 2",
"slug": "LAX2"
}
}
}
}
}Elastic Ips
Retrieve a BGP session
Retrieve a BGP session announcing an elastic IP
GET
/
elastic_ips
/
{elastic_ip_id}
/
bgp_sessions
/
{id}
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.elasticIps.getElasticIpBgpSession({
elasticIpId: "ueip_e8pKq015DWAob",
id: "bgps_w49QDB9PqagKb",
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ElasticIps.GetElasticIPBgpSession(ctx, "ueip_e8pKq015DWAob", "bgps_w49QDB9PqagKb")
if err != nil {
log.Fatal(err)
}
if res.BgpSession != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}', 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.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/elastic_ips/{elastic_ip_id}/bgp_sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "bgps_w49QDB9PqagKb",
"type": "bgp_sessions",
"attributes": {
"status": "active",
"status_message": null,
"server_ip": "162.43.189.161",
"asn": 65001,
"created_at": "2026-07-24T10:00:00Z",
"server": {
"id": "sv_A05EdQp4OvKYQ",
"hostname": "para-bgp-3",
"primary_ipv4": "162.43.189.161",
"operating_system": "ubuntu_24_04_x64_lts"
},
"region": {
"id": "reg_qOxWMz15VGAwd",
"name": "United States",
"location": {
"id": "loc_Yb7VpP53OjxEr",
"name": "Los Angeles 2",
"slug": "LAX2"
}
}
}
}
}Was this page helpful?
⌘I