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
}
'import requests
url = "https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}"
payload = {
"url": "http://domain.com/myoverlay_new_3.html",
"width": None,
"height": None,
"x": None,
"y": None,
"stretch": True
}
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({
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}"
payload := strings.NewReader("{\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}")
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/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)."
}{
"status": 404,
"error": "Not Found. Entity you are looking for was not found, please check the initial parameters"
}{
"error": "Feature is disabled. Contact support to enable."
}Change an overlay
Updates overlay settings
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
}
'import requests
url = "https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}"
payload = {
"url": "http://domain.com/myoverlay_new_3.html",
"width": None,
"height": None,
"x": None,
"y": None,
"stretch": True
}
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({
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/streaming/streams/{stream_id}/overlays/{overlay_id}"
payload := strings.NewReader("{\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}")
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/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)."
}{
"status": 404,
"error": "Not Found. Entity you are looking for was not found, please check the initial parameters"
}{
"error": "Feature is disabled. Contact support to enable."
}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
Body
Valid http/https URL to an HTML page/widget
Width of the widget
Height of the widget
Coordinate of left upper corner
Coordinate of left upper corner
Switch of auto scaling the widget. Must not be used as "true" simultaneously with the coordinate installation method (w, h, x, y).
Response
Successful
Valid http/https URL to an HTML page/widget
ID of the overlay
ID of a stream to which it is attached
Datetime of creation in ISO 8601
Datetime of last update in ISO 8601
Width of the widget
Height of the widget
Coordinate of left upper corner
Coordinate of left upper corner
Switch of auto scaling the widget. Must not be used as "true" simultaneously with the coordinate installation method (w, h, x, y).
Was this page helpful?