Get ICE Servers
curl --request GET \
--url https://api.example.com/api/v1/apps/:appId/ice-serversimport requests
url = "https://api.example.com/api/v1/apps/:appId/ice-servers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/apps/:appId/ice-servers', 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.example.com/api/v1/apps/:appId/ice-servers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/apps/:appId/ice-servers"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v1/apps/:appId/ice-servers")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/apps/:appId/ice-servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data.iceServers": [
{}
]
}Visitors & Calls
Get ICE Servers
Fetch STUN/TURN server configuration for WebRTC voice/video calls.
GET
/
api
/
v1
/
apps
/
:appId
/
ice-servers
Get ICE Servers
curl --request GET \
--url https://api.example.com/api/v1/apps/:appId/ice-serversimport requests
url = "https://api.example.com/api/v1/apps/:appId/ice-servers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/apps/:appId/ice-servers', 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.example.com/api/v1/apps/:appId/ice-servers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/apps/:appId/ice-servers"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v1/apps/:appId/ice-servers")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/apps/:appId/ice-servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data.iceServers": [
{}
]
}Overview
Returns the ICE server configuration (STUN and TURN) a WebRTC client needs to establish voice/video calls. The shape matches the browser’sRTCConfiguration.iceServers, so you can
pass it straight into an RTCPeerConnection.
The SDK calls this for you when you set appId + apiUrl on the client — you usually don’t
need to call it directly. See Voice & Video Calls (SDK).
Auth: any valid caller for the app — a dashboard JWT, an SDK token
(
Authorization: Bearer …), or X-Api-Key + X-Api-Secret.Path Parameters
string
required
App ID (UUID).
Example Request
curl https://dev.vocantly.com/api/v1/apps/YOUR_APP_ID/ice-servers \
-H "Authorization: Bearer SDK_TOKEN"
Response
array
Array of ICE server entries (
{ urls, username?, credential? }).Success (200)
{
"success": true,
"data": {
"iceServers": [
{ "urls": "stun:stun.l.google.com:19302" },
{
"urls": ["turn:turn.vocantly.com:3478"],
"username": "vocantly",
"credential": "…"
}
]
}
}
Using it directly
const { data } = await fetch(
`${apiUrl}/apps/${appId}/ice-servers`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
const pc = new RTCPeerConnection({ iceServers: data.iceServers });
If no
turn: entry is returned, calls will fail for participants behind strict NATs. Make
sure a TURN server is configured for your app.How calls work
Signaling, ICE/TURN, and the call lifecycle.