Update Platform
Update the platform of a publish stream
curl -X POST "https://api.5centscdn.com/v2/streams/publish/1001/platform/1" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"platform": {
"name": "My Platform",
"rtmp": "rtmp://a.rtmp.youtube.com/live2",
"key": "5t1d-hvka-50ga-7dj0-38h0",
"auth": "N",
"username": "myusername",
"password": "mypassword",
"schedule": "instant",
"scheduleontime": "08:00:00",
"length": "01:00:00",
"transcodetype": "hd",
"vprofiles": [
1
],
"aprofiles": [
1
],
"filters": [
1
]
}
}'
import requests
import json
url = "https://api.5centscdn.com/v2/streams/publish/1001/platform/1"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"platform": {
"name": "My Platform",
"rtmp": "rtmp://a.rtmp.youtube.com/live2",
"key": "5t1d-hvka-50ga-7dj0-38h0",
"auth": "N",
"username": "myusername",
"password": "mypassword",
"schedule": "instant",
"scheduleontime": "08:00:00",
"length": "01:00:00",
"transcodetype": "hd",
"vprofiles": [
1
],
"aprofiles": [
1
],
"filters": [
1
]
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/streams/publish/1001/platform/1", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"platform": {
"name": "My Platform",
"rtmp": "rtmp://a.rtmp.youtube.com/live2",
"key": "5t1d-hvka-50ga-7dj0-38h0",
"auth": "N",
"username": "myusername",
"password": "mypassword",
"schedule": "instant",
"scheduleontime": "08:00:00",
"length": "01:00:00",
"transcodetype": "hd",
"vprofiles": [
1
],
"aprofiles": [
1
],
"filters": [
1
]
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"platform": {
"name": "My Platform",
"rtmp": "rtmp://a.rtmp.youtube.com/live2",
"key": "5t1d-hvka-50ga-7dj0-38h0",
"auth": "N",
"username": "myusername",
"password": "mypassword",
"schedule": "instant",
"scheduleontime": "08:00:00",
"length": "01:00:00",
"transcodetype": "hd",
"vprofiles": [
1
],
"aprofiles": [
1
],
"filters": [
1
]
}
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/streams/publish/1001/platform/1", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/streams/publish/1001/platform/1')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"platform": {
"name": "My Platform",
"rtmp": "rtmp://a.rtmp.youtube.com/live2",
"key": "5t1d-hvka-50ga-7dj0-38h0",
"auth": "N",
"username": "myusername",
"password": "mypassword",
"schedule": "instant",
"scheduleontime": "08:00:00",
"length": "01:00:00",
"transcodetype": "hd",
"vprofiles": [
1
],
"aprofiles": [
1
],
"filters": [
1
]
}
}'
response = http.request(request)
puts response.body
{
"result": "success",
"message": "Stream Updated",
"stream": "null"
}
/streams/publish/{streamid}/platform/{platformid}Target server for requests. Edit to use your own host.
API key (sent in header)
Stream ID
Platform ID
The media type of the request body
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Path Parameters
Body
Platform name. Name should have minimum 2 chars, and maximum 32 chars length.
My PlatformValues Can be Y or N. Set to Y if Publish Auth should be enabled. Set to N if Publish Auth should be disabled.
NScheduleontime should be in the format of hh:mm:ss. It can be used if the schedule is scheduleontime. Scheduleondatetime format should be yyyy-mm-dd hh:min:sec. It can be used if schedule is scheduleondatetime.
08:00:00Length should be in the format hh:mm:ss. length can be set if type is live.
01:00:00Transcode profile ids from the GET streams/settings/profiles call
Transcode profile ids from the GET streams/settings/profiles call
Responses
Status of the API response.
Human-readable message describing the result.