Reconnect with a new SDP offer
Sends a new SDP offer on an existing connection, for an ICE restart or a network change.
The body and the flow are the same as POST: poll GET for the new answer.
Only the user who started the session may call this. A session token works only for the sessions bound to it.
PUT
/
sessions
/
{session_id}
/
transport
/
webrtc
/
connections
/
{connection_id}
/
sdp_params
Reconnect with a new SDP offer
curl --request PUT \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sdp_offer": "v=0\r\no=- 4611731400430051337 3 IN IP4 127.0.0.1\r\n..."
}
'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params"
payload = { "sdp_offer": "v=0
o=- 4611731400430051337 3 IN IP4 127.0.0.1
..." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sdp_offer: 'v=0\r\no=- 4611731400430051337 3 IN IP4 127.0.0.1\r\n...'})
};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params', 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}/sdp_params",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sdp_offer' => 'v=0
o=- 4611731400430051337 3 IN IP4 127.0.0.1
...'
]),
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}/sdp_params"
payload := strings.NewReader("{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}"
response = http.request(request)
puts response.read_body{
"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>"
}{
"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.
The connection's ID, as returned when it was registered.
Required range:
1001 <= x <= 9999Example:
4321
Body
application/json
Response
The offer was accepted. Poll for the answer.
⌘I
Reconnect with a new SDP offer
curl --request PUT \
--url https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sdp_offer": "v=0\r\no=- 4611731400430051337 3 IN IP4 127.0.0.1\r\n..."
}
'import requests
url = "https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params"
payload = { "sdp_offer": "v=0
o=- 4611731400430051337 3 IN IP4 127.0.0.1
..." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sdp_offer: 'v=0\r\no=- 4611731400430051337 3 IN IP4 127.0.0.1\r\n...'})
};
fetch('https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params', 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}/sdp_params",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sdp_offer' => 'v=0
o=- 4611731400430051337 3 IN IP4 127.0.0.1
...'
]),
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}/sdp_params"
payload := strings.NewReader("{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/sessions/{session_id}/transport/webrtc/connections/{connection_id}/sdp_params")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp_offer\": \"v=0\\r\\no=- 4611731400430051337 3 IN IP4 127.0.0.1\\r\\n...\"\n}"
response = http.request(request)
puts response.read_body{
"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>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}