Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
overlay = client.streaming.streams.overlays.update(
overlay_id=0,
stream_id=0,
)
print(overlay.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
overlay, err := client.Streaming.Streams.Overlays.Update(
context.TODO(),
0,
streaming.StreamOverlayUpdateParams{
StreamID: 0,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", overlay.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "http://domain.com/myoverlay_new_3.html",
"width": null,
"height": null,
"x": null,
"y": null,
"stretch": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'http://domain.com/myoverlay_new_3.html',
width: null,
height: null,
x: null,
y: null,
stretch: true
})
};
fetch('https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_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/streams/{stream_id}/overlays/{overlay_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([
'url' => 'http://domain.com/myoverlay_new_3.html',
'width' => null,
'height' => null,
'x' => null,
'y' => null,
'stretch' => true
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"http://domain.com/myoverlay_new_3.html\",\n \"width\": null,\n \"height\": null,\n \"x\": null,\n \"y\": null,\n \"stretch\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_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 \"url\": \"http://domain.com/myoverlay_new_3.html\",\n \"width\": null,\n \"height\": null,\n \"x\": null,\n \"y\": null,\n \"stretch\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"stream_id": 12345,
"url": "http://domain.com/myoverlay1.html",
"width": 120,
"height": 40,
"x": 30,
"y": 30,
"stretch": false,
"created_at": "2023-09-20T00:01:01.000Z",
"updated_at": "2023-10-01T12:01:01.000Z"
}{
"status": 400,
"error": "Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."
}{
"error": "Couldn't find Video with 'id'=100"
}{
"error": "Feature is disabled. Contact support to enable."
}Overlays
Change an overlay
Updates overlay settings
PATCH
/
streaming
/
streams
/
{stream_id}
/
overlays
/
{overlay_id}
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
overlay = client.streaming.streams.overlays.update(
overlay_id=0,
stream_id=0,
)
print(overlay.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
overlay, err := client.Streaming.Streams.Overlays.Update(
context.TODO(),
0,
streaming.StreamOverlayUpdateParams{
StreamID: 0,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", overlay.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "http://domain.com/myoverlay_new_3.html",
"width": null,
"height": null,
"x": null,
"y": null,
"stretch": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'http://domain.com/myoverlay_new_3.html',
width: null,
height: null,
x: null,
y: null,
stretch: true
})
};
fetch('https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_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/streams/{stream_id}/overlays/{overlay_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([
'url' => 'http://domain.com/myoverlay_new_3.html',
'width' => null,
'height' => null,
'x' => null,
'y' => null,
'stretch' => true
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"http://domain.com/myoverlay_new_3.html\",\n \"width\": null,\n \"height\": null,\n \"x\": null,\n \"y\": null,\n \"stretch\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_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 \"url\": \"http://domain.com/myoverlay_new_3.html\",\n \"width\": null,\n \"height\": null,\n \"x\": null,\n \"y\": null,\n \"stretch\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"stream_id": 12345,
"url": "http://domain.com/myoverlay1.html",
"width": 120,
"height": 40,
"x": 30,
"y": 30,
"stretch": false,
"created_at": "2023-09-20T00:01:01.000Z",
"updated_at": "2023-10-01T12:01:01.000Z"
}{
"status": 400,
"error": "Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."
}{
"error": "Couldn't find Video with 'id'=100"
}{
"error": "Feature is disabled. Contact support to enable."
}Authorizations
Body
application/json
Response
Successful
Was this page helpful?