Start / Stop Publishing

Start or stop publishing to a social media or content distribution platform.

Request

Request syntax:

PATCH /syndication-schedule-action/Publishing Schedule 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 Schedule ID RequiredReplace this variable with the system-defined ID assigned to the desired publishing scheduleRefers 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.. 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 parameter:

NameData TypeDescription
modeStringDetermines whether to start or stop publishing. Valid values are: start: Toggles the publishing schedule's status to active. stop: Toggles the publishing schedule's status to stopped. Use this parameter to toggle the current status. An active publishing schedule cannot be started. Likewise, you cannot stop a publishing schedule that has already been stopped.

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to the endpoint that was requested.
@typeStringReturns StartSyndicationSchedule.
audio_trackStringIndicates the name of the audio track that will be published.
content_idStringIdentifies a live channel or live event by its system-defined ID.
content_typeStringIndicates whether the content_id parameter identifies a live channel or a live event. Valid values are: e: Live Event c: Live Channel
err_msgStringIndicates the publishing schedule's last error message. The system generates an error message whenever the publishing schedule's status is set to error.
idStringIndicates the system-defined ID for the publishing schedule.
last_statusStringIndicates the timestamp, in Unix time (milliseconds), at which the publishing schedule's status was last updated.
regionStringIndicates 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_selectedBooleanIndicates whether the output location was auto selected.
scte35_enabledIntegerHLS (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 DeprecatedStringThis parameter has been deprecated.
startIntegerIndicates the timestamp, in Unix time (milliseconds), at which the publishing schedule was last started.
statusStringIndicates the publishing schedule's status. Valid values are: activestoppingstoppedschedulederror
stopIntegerIndicates 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_descriptionStringIndicates the description for the publishing target.
syndication_target_idStringIndicates 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_configDictionaryHLS (Push/Pull) or Zixi (Push) Contains a social media or content distribution platform's settings.
typeStringReserved for future use.
video_qualityStringIndicates the stream quality that will be published to the social media or content distribution platform. Valid values are: highmediumlow

target_platform_config Dictionary

The target_platform_config dictionary describes a social media or content distribution platform's settings via the following properties:

NameData TypeDescription
broadcast_idStringReserved for internal use.
channel_id_pristineStringReserved for internal use.
hls_master_urlStringHLS (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.
integratedBooleanReserved for future use.
integrated_descriptionStringFacebook and YouTube (Integrated Authentication) Indicates the video's description.
integrated_titleStringFacebook and YouTube (Integrated Authentication) Indicates the video's title.
integrated_yt_made_for_kidsBooleanYouTube (Integrated Authentication) Only Indicates whether the video is appropriate for kids.
integrated_yt_privacyStringYouTube (Integrated Authentication) Only Indicates the video's privacy level. Valid values are: publicprivateunlisted
raysList of string valuesHLS (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_idStringReserved for internal use.

Sample Request/Response

Call the start_stop_publishing module (Python 3) to start or stop a publishing schedule. This module imports names from the api_auth module.

import json
import requests
from api_auth import APICredentials, APIParams

class StartStopPublishingSchedule:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._action_publishing_schedule()

    def _action_publishing_schedule(self):

        publishing_schedule_id = '04359728c4d346ac918ba7b3edff2cb1'
        url = "{}{}{}".format(self.host, "/api/v4/syndication-schedule-action/", publishing_schedule_id)

        payload = {
            'mode': 'stop'
        }

        headers = {'Content-Type': 'application/json'}

        response = requests.patch(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )

        print(response.json())

StartStopPublishingSchedule().run()

Response:

{
	"@id": "/api/v4/syndication-schedule-action/04359728c4d346ac918ba7b3edff2cb1",
	"@type": "StartSyndicationSchedule",
	"id": "04359728c4d346ac918ba7b3edff2cb1",
	"start": 1588098944096,
	"stop": 1588098960071,
	"syndication_target_id": "d30f655670cb426c98cd28afb6291bf4",
	"status": "stopped",
	"last_status": 1588098960071,
	"err_msg": "",
	"type": "downloader",
	"video_quality": "high",
	"audio_track": "",
	"content_id": "1df8d13992cd4222a7343b8fafd89cd7",
	"content_type": "c",
	"syndication_target_description": "Sample"
}