Update CSL

Updates a CSL slicer.

Request

Request syntax:

PATCH /managed-slicer/slicers/CSL Slicer 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
CSL Slicer ID RequiredReplace this variable with the system-defined ID assigned to the desired CSL slicer. Use the Get All CSL Slicers endpoint to retrieve a list of CSL slicers and their system-defined IDs.

Request body parameters:

Pass the following request body parameters:

NameData TypeDescription
configurationStringDefines the slicer's configuration. Specify each setting as a key-value pair. Use a new line character (\n) to delimit each setting. Example: 'configuration': 'slicerID:basketballSlicer\nremote:1\nmeta:event=March Madness'
notesStringDefines the slicer's notes.
slicer_idStringSets the slicer's ID. Use this ID to identify this slicer when setting up a live channel or a live event.
version_idStringIdentifies a slicer version by its system-defined ID. This slicer runs on this slicer version. You must specify a slicer version that is specific to the region defined within this slicer's ingest point (reserved_endpoint_id property).

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path that returns this resource.
@typeStringReturns ManagedSlicer.
status_codeNumberIndicates the response's HTTP status code.
messageStringIndicates a status message for the requested CSL slicer update.

Sample Request/Response

Call the update_csl_slicer module (Python 3) to update a CSL slicer. This module imports names from the api_auth module.

import json, requests, datetime, time
from api_auth import APICredentials, APIParams

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

    def run(self):
        """
        Update a CSL slicer.
        """
        self._update_csl_slicer()

    def _update_csl_slicer(self):
        csl_slicer_id = '2803da54cb8e47668f36908bef564fee'  # Replace with the desired CSL slicer ID.
        url = "{}{}{}".format(self.host, "/api/v4/managed-slicer/slicers", csl_slicer_id)

        payload = {
            'slicer_name': 'Basketball Slicer Courtside', # Replace with the CSL slicer's name.
            'slicer_id': 'basketball_slicer_courtside' # Replace with the CSL slicer's Slicer ID.
        }

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

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

        print(response.json())

CSLSlicer().run()

Response:

{
    '@id': '/api/v4/managed-slicer/slicers/1234a2ab35414027b80c05a5c6c568ec',
    '@type': 'ManagedSlicer',
    'status_code': 200,
    'message': 'Slicer Update OK'
}