Get ICE servers
Returns the STUN and TURN servers to configure your peer connection with. They match the session’s placement, and TURN entries carry short-lived credentials.
Only the user who started the session may call this. A session token works only for the sessions bound to it.
GET
/
sessions
/
{session_id}
/
transport
/
webrtc
/
ice_servers
Get ICE servers
curl --request GET \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers",
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: Bearer <token>"
],
]);
$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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ice_servers": [
{
"uris": [
"turn:turn.example.reactor.inc:443"
],
"credentials": {
"username": "1762790400:0d7a1c4e",
"password": "q8Zx1vR3..."
}
},
{
"uris": [
"stun:stun.example.reactor.inc:3478"
]
}
]
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}Authorizations
apiKeysessionToken
A Reactor API key (rk_...), sent as Authorization: Bearer rk_.... Keep it on a server.
Headers
The API protocol version the client speaks. Currently 1. Older versions than the server's minimum get 426.
Example:
"1"
The WebRTC signaling protocol version, as major.minor.
Example:
"1.0"
Path Parameters
The session's ID, as returned by POST /sessions.
Response
The ICE servers.
Show child attributes
Show child attributes
⌘I
Get ICE servers
curl --request GET \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers",
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: Bearer <token>"
],
]);
$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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/ice_servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ice_servers": [
{
"uris": [
"turn:turn.example.reactor.inc:443"
],
"credentials": {
"username": "1762790400:0d7a1c4e",
"password": "q8Zx1vR3..."
}
},
{
"uris": [
"stun:stun.example.reactor.inc:3478"
]
}
]
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}