Validate Stream URL

Validates that our service can connect to a social media or content distribution platform using the stream URL associated with a specific 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..

This endpoint cannot be used to verify HLS pull streams, since our service does not connect to a social media or content distribution platform when publishing a pull target. Rather, it is up to the social media or content distribution platform to pull the stream using the publishing schedule's HLS pull URL.

Request

Request syntax:

PATCH /syndication-target-test/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 RequiredReplace 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:

NameData TypeDescription
testStringSet this parameter to rtmp-connection.

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to an endpoint that returns this publishing target.
@typeStringReturns SyndicationTargetAction.
descriptionStringIndicates a description for the social media or content distribution platform.
idStringIdentifies this publishing target by its system-defined ID.
platformStringIdentifies a social media or content distribution platform by its name. Valid values are: FacebookYouTubeTwitchPeriscope ZixiOther
platform_configDictionaryContains additional platform-specific settings.
statusStringIndicates 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_protocolStringIndicates the protocol through which your content will be published. Valid values are: rtmprtmpshlshls-pullzixisrtrist
target_streamStringReturns ******. This value represents the URL to which your stream will be published.
testDictionaryContains the results of the stream URL validation.
platform_config Dictionary

The platform_config dictionary contains the following platform-specific settings:

NameData TypeDescription
clipping_profile_idStringFacebook 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.
hostStringAWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Indicates the hostname or IP address for the desired platform or your Zixi-enabled device.
integratedBooleanFacebook 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_idStringFacebook 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).
passwordStringAWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Returns ******. This value represents the password of the stream to which your content will be published.
portIntegerIndicates the port for the desired platform or platform-enabled device. Zixi-enabled devices and servers typically listen on port 2088.
re_scheduleBooleanFacebook Only Indicates whether our service will create and then publish a new Facebook live event upon reaching Facebook's live event time limit.
remote_idStringReserved for future use.
stream_idStringAWS Elemental MediaConnect, Pluto TV, and ZIXI (Push) Returns ******. This value represents the ID of the stream to which your content will be published.
typeStringReturns push.

test Dictionary

The test dictionary contains the results for the following tests:

  • Stream URL syntax.
  • Social media or content distribution platform connection.
NameData TypeDescription
passedList of string valuesContains a message for each test that passed. Example: uri is valid
failedList of string valuesContains a message for each test that failed. Example: failure to connect via rtmp

Sample Request/Response

Call the validate_stream_url module (Python 3) to validate a stream URL. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams

import json
import requests
from api_auth import APICredentials, APIParams

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

    def run(self):
        self._validate_stream_url()

    def _validate_stream_url(self):
        publishing_target_id = 'b7abed5070384462ae0fec6bd791262e'
        url = "{}{}{}".format(self.host, "/api/v4/syndication-target-test/", publishing_target_id)

        payload = {'test': 'rtmp-connection'}
        headers = {'Content-Type': 'application/json'}
        response = requests.patch(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )

        print(response.json())

ValidateStreamURL().run()

Response:

{
	"@id": "/api/v4/syndication-target-test/b7abed5070384462ae0fec6bd791262e",
	"@type": "SyndicationTargetAction",
	"id": "b7abed5070384462ae0fec6bd791262e",
	"platform": "Facebook",
	"description": "Facebook publishing",
	"target_protocol": "rtmp",
	"target_stream": "******",
	"status": "stopped",
	"test": {
		"passed": [
			"uri is valid"
		],
		"failed": [
			"failure to connect via rtmp"
		]
	}
}