Send ICE candidates
Forwards a batch of the client’s ICE candidates (trickle ICE) to the model’s runtime for
this connection. Delivery is asynchronous: 202 means the batch was accepted, not that
the runtime applied it. Set is_final on the last batch.
The session is always the one in the path. A session_id in the body is ignored, and the
response carries a warning saying so.
Only the user who started the session may call this. A session token works only for the sessions bound to it.
curl --request POST \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"candidates": [
{
"candidate": "candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host",
"sdp_mid": "0",
"sdp_mline_index": 0
}
],
"is_final": false,
"client_info": {
"sdk_version": "3.4.0",
"sdk_type": "js"
}
}
'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates"
payload = {
"candidates": [
{
"candidate": "candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host",
"sdp_mid": "0",
"sdp_mline_index": 0
}
],
"is_final": False,
"client_info": {
"sdk_version": "3.4.0",
"sdk_type": "js"
}
}
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({
candidates: [
{
candidate: 'candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host',
sdp_mid: '0',
sdp_mline_index: 0
}
],
is_final: false,
client_info: {sdk_version: '3.4.0', sdk_type: 'js'}
})
};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates', 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/connections/{connection_id}/ice_candidates",
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([
'candidates' => [
[
'candidate' => 'candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host',
'sdp_mid' => '0',
'sdp_mline_index' => 0
]
],
'is_final' => false,
'client_info' => [
'sdk_version' => '3.4.0',
'sdk_type' => 'js'
]
]),
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://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates"
payload := strings.NewReader("{\n \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\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://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates")
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 \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
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.
"1"
The WebRTC signaling protocol version, as major.minor.
"1.0"
Path Parameters
The session's ID, as returned by POST /sessions.
The connection's ID, as returned when it was registered.
1001 <= x <= 99994321
Body
Response
The candidates were accepted.
Present when the body carried a session_id, which is ignored.
curl --request POST \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"candidates": [
{
"candidate": "candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host",
"sdp_mid": "0",
"sdp_mline_index": 0
}
],
"is_final": false,
"client_info": {
"sdk_version": "3.4.0",
"sdk_type": "js"
}
}
'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates"
payload = {
"candidates": [
{
"candidate": "candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host",
"sdp_mid": "0",
"sdp_mline_index": 0
}
],
"is_final": False,
"client_info": {
"sdk_version": "3.4.0",
"sdk_type": "js"
}
}
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({
candidates: [
{
candidate: 'candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host',
sdp_mid: '0',
sdp_mline_index: 0
}
],
is_final: false,
client_info: {sdk_version: '3.4.0', sdk_type: 'js'}
})
};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates', 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/connections/{connection_id}/ice_candidates",
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([
'candidates' => [
[
'candidate' => 'candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host',
'sdp_mid' => '0',
'sdp_mline_index' => 0
]
],
'is_final' => false,
'client_info' => [
'sdk_version' => '3.4.0',
'sdk_type' => 'js'
]
]),
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://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates"
payload := strings.NewReader("{\n \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\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://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/ice_candidates")
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 \"candidates\": [\n {\n \"candidate\": \"candidate:1 1 udp 2122260223 192.168.1.10 54321 typ host\",\n \"sdp_mid\": \"0\",\n \"sdp_mline_index\": 0\n }\n ],\n \"is_final\": false,\n \"client_info\": {\n \"sdk_version\": \"3.4.0\",\n \"sdk_type\": \"js\"\n }\n}"
response = http.request(request)
puts response.read_body