Updates a publishing targetRefers to a configuration that identifies the URL to which your content may be published. A publishing schedule leverages a publishing target configuration to syndicate a live channel or a live event to a social media platform. configuration.
Request
Request syntax:
PATCH /syndication-target/Publishing Target ID
Define the following variable when submitting the above request:
VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). | Description |
---|---|
Publishing Target ID Required | Replace this variable with the system-defined ID assigned to the desired publishing target configuration. Use the Get Multiple Publishing Targets endpoint to retrieve a list of publishing targets and their system-defined ID. |
Request body parameters:
Pass the following request body parameters:
Name | Data Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
description | String | Indicates a description for the social media or content distribution platform. | ||||||
platform Required | String | Identifies a social media or content distribution platform by its case-sensitive name. Valid values are: AWS Elemental MediaConnect | Custom | Pluto TV | TikTok | Twitch | YouTube | |
platform_config | Dictionary | Contains additional platform-specific settings. | ||||||
target_protocol Required | String | Indicates the protocol through which your content will be published. Valid values are: rtmp | rtmps | hls | hls-push | zixi | srt | rist Key information: AWS Elemental MediaConnect or Pluto TV: Set this parameter to zixi. Facebook, YouTube, TikTok, or Twitch: Set this parameter to rtmp. |
target_stream Required | String | Required for Facebook (stream key), TikTok, Twitch, YouTube (stream key), and Custom (RTMP, RTMPS, HLS - Push, SRT - Push, and RIST - Push) Identifies the stream to which your content will be published. This parameter's configuration varies by platform. Facebook, TikTok, Twitch, and YouTube Set this parameter to the desired stream key. If you are publishing to Facebook and the integrated parameter is set to true, then your live stream will be published according to the page_id parameter instead. If you are publishing to YouTube and the integrated parameter is set to true, then your live stream will be published to a YouTube Studio dashboard instead. Please refer to the documentation provided by the desired social media or content distribution platform to learn where to find your stream key(s). Custom (RTMP, RTMPS, HLS - Push, SRT - Push, and RIST - Push) Set this parameter to the desired stream URL. ClosedView syntax. RTMP or RTMPS - Push Stream URL Syntax: Base Stream URL/Stream Key The desired social media or content distribution platform determines whether a stream key must be defined within your stream URL. Please refer to their documentation for more information. HLS - Push Stream URL Syntax: Base Stream URL/ Sample stream URLs: rtmp://platform.example.com/live/3u40-9rqs-502b-7zeq/ http://platform.example.com/live/ Please refer to the documentation provided by the desired social media or content distribution platform to find out where your stream URL(s) or stream key(s) can be found. HLS - Pull Our service generates a stream URL once you start publishing to this target. You will need to configure the desired social media or content distribution platform to pull the stream using this URL. SRT - Push Stream URL Syntax: srt://HostReplace this variable with the hostname of the desired SRT-enabled server or service.:Port RIST - Push Stream URL Syntax: rist://HostReplace this variable with the hostname of the desired RIST-enabled server or service.:Port You may only push an audio/video feed to an even port number. RIST reserves odd port numbers (Port+1) for error correction use. |
platform_config Dictionary
The platform_config dictionary contains the following platform-specific settings:
Name | Data Type | Description |
---|---|---|
clipping_profile_id | String | Facebook and YouTube (Integrated Authentication) Identifies the Clipping profile, whose credentials will be used to authenticate to Facebook or YouTube, by its system-defined ID. Use the Get Syndication Publishing-Compatible Clipping Profiles endpoint to retrieve Clipping profiles and their system-defined IDs. |
host Required | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Identifies the hostname or IP address for the desired platform or your Zixi-enabled device. |
integrated | Boolean | Facebook and YouTube Determines how your live stream will be published to Facebook or YouTube. Valid values are: true: Live streams will be published using integrated authentication to either: + The Facebook page identified by the page_id property. + A YouTube Studio dashboard. false: Live streams will be published to the stream URL identified by the target_stream property. Default value: false |
page_id Required | String | Facebook Only: Required when the integrated property is set to true. Identifies a Facebook page by its system-defined ID. Your live stream will be published to this page. Learn more (Live Channels). Learn more (Live Events). |
password Required | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Identifies the password of the stream to which your content will be published. |
port Required | Integer | Identifies the port for the desired platform or platform-enabled device. Zixi-enabled devices and servers typically listen on port 2088. |
re_schedule | Boolean | Facebook Only Determines whether our service will create and then publish a new Facebook live event upon reaching Facebook's live event time limit. Default value: false |
stream_id Required | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Identifies the ID of the stream to which your content will be published. |
type | String | Set to push. |
Response
The response for a successful request contains the following properties:
Name | Data Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
@id | String | Indicates the relative path to an endpoint that returns this publishing target. | ||||||
@type | String | Returns SyndicationTarget. | ||||||
description | String | Indicates a description for the social media or content distribution platform. | ||||||
id | String | Identifies this publishing target by its system-defined ID. | ||||||
platform | String | Identifies a social media or content distribution platform by its case-sensitive name. Valid values are: AWS Elemental MediaConnect | Custom | Pluto TV | TikTok | Twitch | YouTube | |
platform_config | Dictionary | Contains additional platform-specific settings. | ||||||
status | String | Indicates the publishing target's status. Valid values are: activeIndicates that one or more publishing schedules that leverage this publishing target are in the active state. | stoppedIndicates that none of the publishing schedules that leverage this publishing target are in the active or error state. | errorIndicates that one or more publishing schedules that leverage this publishing target are in the error state. | ||||
target_protocol | String | Indicates the protocol through which your content will be published. Valid values are: rtmp | rtmps | hls | hls-push | zixi | srt | rist |
target_stream | String | Returns ******. This value represents either a stream URL or a stream key when the integrated parameter is set to false. |
platform_config Dictionary
The platform_config dictionary contains the following platform-specific settings:
Name | Data Type | Description |
---|---|---|
clipping_profile_id | String | Facebook and YouTube (Integrated Authentication) Indicates the Clipping profile, whose credentials will be used to authenticate to Facebook or YouTube, by its system-defined ID. Use the Get Syndication Publishing-Compatible Clipping Profiles endpoint to retrieve Clipping profiles and their system-defined IDs. |
host | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Indicates the hostname or IP address for the desired platform or your Zixi-enabled device. |
integrated | Boolean | Facebook and YouTube Indicates how your live stream will be published to Facebook or YouTube. Valid values are: true: Live streams will be published using integrated authentication to either: + The Facebook page identified by the page_id property. + A YouTube Studio dashboard. false: Live streams will be published to the stream URL identified by the target_stream property. |
page_id | String | Facebook Only Identifies a Facebook page by its system-defined ID. Your live stream will be published to this page. Learn more (Live Channels). Learn more (Live Events). |
password | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Returns ******. This value represents the password of the stream to which your content will be published. |
port | Integer | Indicates the port for the desired platform or platform-enabled device. Zixi-enabled devices and servers typically listen on port 2088. |
re_schedule | Boolean | Facebook Only Indicates whether our service will create and then publish a new Facebook live event upon reaching Facebook's live event time limit. |
remote_id | String | Reserved for future use. |
stream_id | String | AWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Returns ******. This value represents the ID of the stream to which your content will be published. |
type | String | Returns push. |
Sample Request/Response
Call the update_publishing_target module (Python 3) to update a publishing target configuration. This module imports names from the api_auth module.
import json
import requests
from api_auth import APICredentials, APIParams
class PublishingTarget:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._update_publishing_target()
def _update_publishing_target(self):
publishing_target_id = '587be125932f4428b83e4435e41503b7'
url = "{}{}{}".format(self.host, "/api/v4/syndication-target/", publishing_target_id)
payload = {
'target_stream': 'rtmp://platform.example.com/live/3u40-9rqs-502b-7zeq',
'platform': 'Facebook',
'description': 'Facebook publishing',
'target_protocol': 'rtmp',
}
headers = {'Content-Type': 'application/json'}
response = requests.patch(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
PublishingTarget().run()
Response:
{
"@id": "/api/v4/syndication-target/587be125932f4428b83e4435e41503b7",
"@type": "SyndicationTarget",
"id": "587be125932f4428b83e4435e41503b7",
"platform": "Facebook",
"description": "Facebook publishing",
"target_protocol": "rtmp",
"target_stream": "rtmp://platform.example.com/live/3u40-9rqs-502b-7zeq",
"status": "stopped"
}