Change restream
curl --request PATCH \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"restream": {
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
}
}
'import requests
url = "https://api.gcore.com/streaming/restreams/{restream_id}"
payload = { "restream": {
"name": "first restream",
"active": True,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
restream: {
name: 'first restream',
active: true,
uri: 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
stream_id: 20,
client_user_id: 10
}
})
};
fetch('https://api.gcore.com/streaming/restreams/{restream_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://api.gcore.com/streaming/restreams/{restream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'restream' => [
'name' => 'first restream',
'active' => true,
'uri' => 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
'stream_id' => 20,
'client_user_id' => 10
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/streaming/restreams/{restream_id}"
payload := strings.NewReader("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.gcore.com/streaming/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
}This response has no body data.Restreams
Change restream
Updates restream settings, such as the target URI or active status
PATCH
/
streaming
/
restreams
/
{restream_id}
Change restream
curl --request PATCH \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"restream": {
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
}
}
'import requests
url = "https://api.gcore.com/streaming/restreams/{restream_id}"
payload = { "restream": {
"name": "first restream",
"active": True,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
restream: {
name: 'first restream',
active: true,
uri: 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
stream_id: 20,
client_user_id: 10
}
})
};
fetch('https://api.gcore.com/streaming/restreams/{restream_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://api.gcore.com/streaming/restreams/{restream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'restream' => [
'name' => 'first restream',
'active' => true,
'uri' => 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
'stream_id' => 20,
'client_user_id' => 10
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/streaming/restreams/{restream_id}"
payload := strings.NewReader("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.gcore.com/streaming/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
}This response has no body data.Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
Restream ID
Body
application/json
Show child attributes
Show child attributes
Example:
{
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10
}
Response
Successful
Restream name
Indicates that the stream is being published. Has two possible values:
- true — stream is being published
- false — stream isn't published
Enables/Disables restream. Has two possible values:
-
true — restream is enabled and can be started
-
false — restream is disabled.
Default is true
A URL to push the stream to. Supported protocols: rtmp, rtmps, srt. For SRT target URLs, only mode=caller is supported.
Example:
"srt://example.com:1234?mode=caller"
ID of the stream to restream
Custom field where you can specify user ID in your system
Was this page helpful?
⌘I