Update a publishing schedule'sRefers to a configuration that identifies a live channel or live event and a publishing target. Use a publishing schedule to syndicate a live channel or a live event to a social media platform. video quality.
A publishing schedule's video quality may only be modified when its status is stopped.
Request
Request syntax:
PATCH /syndication-schedule/Publishing Schedule ID
Define the following variable when submitting the above request:
| Variable | Description |
|---|---|
| Publishing Schedule ID Required | Replace this variable with the system-defined ID assigned to the desired publishing schedule. Use the Get Multiple Publishing Schedules endpoint to retrieve a list of publishing schedules and their system-defined ID. |
Request body parameter:
Pass the following request body parameters:
| Name | Data Type | Description |
|---|---|---|
| region | String | Identifies a publishing location by its system-defined ID. A publishing location determines where your stream will be converted to a feed that may be ingested by the social media or content distribution platform identified by the publishing target. Set this property to an empty string to use the default output location. Use the Get All Publishing Locations endpoint to retrieve a list of regions and their system-defined IDs. |
| scte35_enabled | Integer | HLS (Push/Pull) or Zixi (Push) Determines whether SCTE-35 markers will be inserted into the published stream. Valid values are: 0: Disabled. 1: Enabled. |
| source_url_params | Dictionary | Define a key-value pair for each desired query string parameter. Syndication Publishing adds these parameters to the playback URL published to your social media or content distribution platform. Example: 'source_url_params': { 'delay': '20', 'ad': 'sportcreatives' } |
| target_platform_config | Dictionary | HLS (Push/Pull) or Zixi (Push) Contains a social media or content distribution platform's setting. |
| url_params_active | Boolean | Determines whether our service may add your custom query string parameters to the playback URLs defined within the manifest file. |
| video_quality | String | Indicates the stream quality that will be published to the social media or content distribution platform. Valid values are: high, medium, low |
target_platform_config Dictionary
The target_platform_config dictionary describes a social media or content distribution platform's settings via the following property:
| Name | Data Type | Description |
|---|---|---|
| integrated_description | String | Facebook and YouTube (Integrated Authentication) Determines the video's description. |
| integrated_title | String | Facebook and YouTube (Integrated Authentication) Determines the video's title. |
| integrated_yt_made_for_kids | Boolean | YouTube (Integrated Authentication) Only Determines whether the video is appropriate for kids. |
| integrated_yt_privacy | String | YouTube (Integrated Authentication) Only Sets the video's privacy level. Valid values are: public, private, unlisted |
| rays | List of string values | HLS (Push/Pull) Only Contains a list of the ray(s) that will be published. Use the Get Rays endpoint to retrieve a list of rays (all) and their names (ray_name). |
| hls_playlist_duration | Integer | HLS (Push/Pull) Only. The HLS playlist duration in seconds. Supported range: 25–300. |
Important:target_platform_configandsource_url_paramsuse full-replace semanticsWhen you include
target_platform_configorsource_url_paramsin a PATCH request, the entire stored object is replaced by what you send. Any keys you omit will be permanently removed. This does not apply to top-level fields such asvideo_qualityorregion, which are safely partial.Always use a read-modify-write pattern:
- GET the publishing schedule to retrieve the current
target_platform_config.- Modify or add the desired keys.
- PATCH with the complete
target_platform_configobject.
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 schedule. |
| @type | String | Returns SyndicationSchedule. |
| audio_track | String | Indicates the name of the audio track that will be published. |
| content_id | String | Identifies a live channel or live event by its system-defined ID. |
| content_type | String | Indicates whether the contentid parameter identifies a live channel or a live event. Valid values are: e: Live Event _ c: Live Channel |
| err_msg | String | Indicates the publishing schedule's last error message. The system generates an error message whenever the publishing schedule's status is set to error. |
| id | String | Indicates the system-defined ID for the publishing schedule. |
| last_status | String | Indicates the timestamp, in Unix time (milliseconds), at which the publishing schedule's status was last updated. |
| region | String | Indicates the location where your stream will be converted to a feed that may be ingested by the social media or content distribution platform identified by the publishing target. An empty string identifies the default output location. |
| region_auto_selected | Boolean | Indicates whether this publishing schedule's publishing location is set to auto selected. |
| scte35_enabled | Integer | HLS (Push/Pull) or Zixi (Push) Indicates whether SCTE-35 markers will be inserted into the published stream. Valid values are: 0: Disabled. 1: Enabled. |
| source_stream Deprecated | String | This parameter has been deprecated. |
| source_url_params | Dictionary | Contains key-value pairs for query string parameters. Syndication Publishing adds these parameters to the playback URL published to your social media or content distribution platform. |
| start | Integer | Indicates the timestamp, in Unix time (milliseconds), at which the publishing schedule was last started. |
| status | String | Indicates the publishing schedule's status. Valid values are: active, stopping, stopped, scheduled, error |
| stop | Integer | Indicates the timestamp, in Unix time (milliseconds), for either of the following conditions: Active Publishing Schedule: Reports one year from the start time. Stopped Publishing Schedule: Reports the timestamp at which the publishing schedule entered the stopped state. |
| syndication_target_description | String | Indicates the description for the publishing target. |
| syndication_target_id | String | Indicates the system-defined ID for the 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.. |
| target_platform_config | Dictionary | HLS (Push/Pull) or Zixi (Push) Contains a social media or content distribution platform's settings. |
| type | String | Returns downloader. |
| url_params_active | Boolean | Indicates whether our service may add your custom query string parameters to the playback URLs defined within the manifest file. |
| video_quality | String | Indicates the stream quality that will be published to the social media or content distribution platform. Valid values are: high, medium, low |
target_platform_config Dictionary
The target_platform_config dictionary describes a social media or content distribution platform's settings via the following properties:
| Name | Data Type | Description |
|---|---|---|
| broadcast_id | String | Reserved for internal use. |
| channel_id_pristine | String | Reserved for internal use. |
| hls_master_url | String | HLS (Pull) Only Indicates the URL to which our service will push a HLS stream 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. |
| integrated | Boolean | Reserved for future use. |
| integrated_description | String | Facebook and YouTube (Integrated Authentication) Indicates the video's description. |
| integrated_title | String | Facebook and YouTube (Integrated Authentication) Indicates the video's title. |
| integrated_yt_made_for_kids | Boolean | YouTube (Integrated Authentication) Only Indicates whether the video is appropriate for kids. |
| integrated_yt_privacy | String | YouTube (Integrated Authentication) Only Indicates the video's privacy level. Valid values are: public, private, unlisted |
| rays | List of string values | HLS (Push/Pull) Contains a list of the ray(s) that will be published. Use the Get Rays endpoint to retrieve a list of rays (all) and their names (ray_name). |
| stream_id | String | Reserved for internal use. |
| hls_playlist_duration | Integer | HLS (Push/Pull) Only. Indicates the HLS playlist duration in seconds. |
Sample Request/Response
This code imports names from the api_auth module for V4 APIs (see below).
The code below shows how to safely update the target_platform_config (read-modify-write)
import json
import requests
from api_auth import APICredentials, APIParams
class PublishingSchedule:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._update_target_platform_config()
def _update_target_platform_config(self):
publishing_schedule_id = '04359728c4d346ac918ba7b3edff2cb1'
url = "{}{}{}".format(self.host, "/api/v4/syndication-schedule/", publishing_schedule_id)
params = APIParams(APICredentials()).get_params({})
headers = {'Content-Type': 'application/json'}
# Step 1: GET the current schedule
response = requests.get(url, params=params, headers=headers)
schedule = response.json()
# Step 2: Modify the desired field
config = schedule.get('target_platform_config', {})
config['hls_playlist_duration'] = 60
# Step 3: PATCH with the full target_platform_config
payload = {'target_platform_config': config}
response = requests.patch(url, params=params, data=json.dumps(payload), headers=headers)
print(response.json())
PublishingSchedule().run()The code below shows how to update a publishing schedule.
import json
import requests
from api_auth import APICredentials, APIParams
class PublishingSchedule:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._update_publishing_schedule()
def _update_publishing_schedule(self):
publishing_schedule_id = '04359728c4d346ac918ba7b3edff2cb1'
url = "{}{}{}".format(self.host, "/api/v4/syndication-schedule/", publishing_schedule_id)
payload = {
'video_quality': 'high',
}
headers = {'Content-Type': 'application/json'}
response = requests.patch(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
PublishingSchedule().run()Response:
{
"@id": "/api/v4/syndication-schedule/04359728c4d346ac918ba7b3edff2cb1",
"@type": "SyndicationSchedule",
"id": "04359728c4d346ac918ba7b3edff2cb1",
"start": "",
"stop": "",
"syndication_target_id": "d30f655670cb426c98cd28afb6291bf4",
"status": "scheduled",
"last_status": "",
"err_msg": "",
"type": "downloader",
"video_quality": "high",
"audio_track": "",
"content_id": "1df8d13992cd4222a7343b8fafd89cd7",
"content_type": "c",
"syndication_target_description": "My Publishing Schedule"
}