Set defaults for quality sets
curl --request PUT \
--url https://api.gcore.com/streaming/quality_sets/default \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"live": {
"id": 77
},
"vod": {
"id": null
}
}
'import requests
url = "https://api.gcore.com/streaming/quality_sets/default"
payload = {
"live": { "id": 77 },
"vod": { "id": None }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({live: {id: 77}, vod: {id: null}})
};
fetch('https://api.gcore.com/streaming/quality_sets/default', 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/quality_sets/default",
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([
'live' => [
'id' => 77
],
'vod' => [
'id' => null
]
]),
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/quality_sets/default"
payload := strings.NewReader("{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/streaming/quality_sets/default")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/quality_sets/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"live": [
{
"id": 77,
"name": "Live 4K UHD 60fps AV1 (custom)",
"default": true,
"qualities": [
{
"id": 1,
"name": "vod2160n"
},
{
"id": 2,
"name": "vod1440n"
}
]
}
],
"vod": []
}{
"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)."
}QualitySets
Set defaults for quality sets
Method to set default quality set for VOD and Live transcoding.
For changing default quality set, specify the ID of the custom quality set from the method GET /quality_sets.
Default value can be reverted to the system defaults (cleared) by setting "id": null.
Live transcoding management:
- You can specify quality set explicitly in POST /streams method, look at attribute “quality_set_id”.
- Otherwise these default values will be used by the system by default.
VOD transcoding management:
- You can specify quality set explicitly in POST /videos method, look at attribute “quality_set_id”.
- Otherwise these default values will be used by the system by default.
PUT
/
streaming
/
quality_sets
/
default
Set defaults for quality sets
curl --request PUT \
--url https://api.gcore.com/streaming/quality_sets/default \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"live": {
"id": 77
},
"vod": {
"id": null
}
}
'import requests
url = "https://api.gcore.com/streaming/quality_sets/default"
payload = {
"live": { "id": 77 },
"vod": { "id": None }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({live: {id: 77}, vod: {id: null}})
};
fetch('https://api.gcore.com/streaming/quality_sets/default', 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/quality_sets/default",
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([
'live' => [
'id' => 77
],
'vod' => [
'id' => null
]
]),
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/quality_sets/default"
payload := strings.NewReader("{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/streaming/quality_sets/default")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/quality_sets/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"live\": {\n \"id\": 77\n },\n \"vod\": {\n \"id\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"live": [
{
"id": 77,
"name": "Live 4K UHD 60fps AV1 (custom)",
"default": true,
"qualities": [
{
"id": 1,
"name": "vod2160n"
},
{
"id": 2,
"name": "vod1440n"
}
]
}
],
"vod": []
}{
"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)."
}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
Was this page helpful?
⌘I