Get Trunk
curl --request GET \
--url https://unpod.ai/api/v2/platform/telephony/trunks/{id}/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/telephony/trunks/{id}/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/telephony/trunks/{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://unpod.ai/api/v2/platform/telephony/trunks/{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>",
"Org-Handle: <org-handle>"
],
]);
$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://unpod.ai/api/v2/platform/telephony/trunks/{id}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unpod.ai/api/v2/platform/telephony/trunks/{id}/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/telephony/trunks/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status_code": 200,
"message": "Trunk fetched successfully.",
"data": {
"id": 12,
"name": "Acme Primary Trunk",
"sip_url": "sip:sip.acme-voice.com",
"transport": "tcp",
"port": "5060",
"auth_username": null,
"auth_password": null,
"allowed_ips": "",
"active": true,
"org_handle": "acme.co"
}
}
{ "status_code": 404, "message": "Trunk not found." }
Trunks
Get Trunk
Fetch a single SIP trunk by id
GET
/
api
/
v2
/
platform
/
telephony
/
trunks
/
{id}
/
Get Trunk
curl --request GET \
--url https://unpod.ai/api/v2/platform/telephony/trunks/{id}/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/telephony/trunks/{id}/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/telephony/trunks/{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://unpod.ai/api/v2/platform/telephony/trunks/{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>",
"Org-Handle: <org-handle>"
],
]);
$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://unpod.ai/api/v2/platform/telephony/trunks/{id}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unpod.ai/api/v2/platform/telephony/trunks/{id}/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/telephony/trunks/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status_code": 200,
"message": "Trunk fetched successfully.",
"data": {
"id": 12,
"name": "Acme Primary Trunk",
"sip_url": "sip:sip.acme-voice.com",
"transport": "tcp",
"port": "5060",
"auth_username": null,
"auth_password": null,
"allowed_ips": "",
"active": true,
"org_handle": "acme.co"
}
}
{ "status_code": 404, "message": "Trunk not found." }
Fetch a single SIP trunk by its
id. Only trunks owned by your organization are
returned - anything else is 404. Secrets are masked.
Prerequisites: API Token + Org-Handle. See Authentication.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Token <your-api-key> |
| Org-Handle | string | Yes | Organization domain handle |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Trunk id |
{
"status_code": 200,
"message": "Trunk fetched successfully.",
"data": {
"id": 12,
"name": "Acme Primary Trunk",
"sip_url": "sip:sip.acme-voice.com",
"transport": "tcp",
"port": "5060",
"auth_username": null,
"auth_password": null,
"allowed_ips": "",
"active": true,
"org_handle": "acme.co"
}
}
{ "status_code": 404, "message": "Trunk not found." }
cURL
curl -s "https://unpod.ai/api/v2/platform/telephony/trunks/12/" \
-H "Authorization: Token <your-api-key>" \
-H "Org-Handle: <your-org-handle>"
Was this page helpful?
⌘I