Live Slicer API vs. Slicer State API
Choosing the Right API
Use the Live Slicer API when you need to dynamically control your live stream—such as marking ad breaks, replacing content, or setting metadata in real time. This API goes through our cloud APIs, making it ideal for remote control and automation.
Use the Slicer API when you need to retrieve status data for one or more Live Slicers or manage slicing schedules, such as scheduling breaks or content replacements in advance. This API communicates directly with the Slicer, providing local access for querying and updating slicing information.
Live Slicer API
The Live Slicer API allows you to dynamically control your live stream, mark ad breaks, replace content, and insert metadata in real time. It interacts with the Live Slicer through Uplynk’s cloud APIs, making it ideal for remote control and automation.
When to Use the Live Slicer API
Use the Live Slicer API when you need to:
- Mark ads, replacement content, or content boundaries.
- Insert or modify metadata in real-time.
- Retrieve detailed Live Slicer status information.
- Perform blackouts or content replacement dynamically.
API Conventions
- Uses POST or GET HTTP methods.
- Accepts a serialized JSON object in the request body.
- Responses contain a JSON object with an
error
field:- 0 = Success
- Non-zero = Error (with additional
msg
details)
Authentication
By default, the Live Slicer API does not require authentication, but it can be configured for authentication using an API key. Requests should include:
- Timestamp: A Unix timestamp that defines a 10-second authentication window.
- cnonce: A unique integer value.
- sig: A SHA-1 hash signature including the endpoint, timestamp, cnonce, and authentication token.
Example authentication signature:
sig_input = '/content_start:1438101883:123:2adf9dd93ca0261ccd04dd879258ef35fa3ff17d'
sig = Base64(SHA1(sig_input))
Key Endpoints
Endpoint | Description |
---|---|
/content_start | Marks the beginning of a new asset. |
/replace_content | Replaces part of the stream with pre-encoded content. |
/blackout | Blacks out a section of the live feed. |
/add_meta | Adds metadata to the current asset. |
/status | Retrieves Live Slicer status information. |
Slicer State API
The Slicer State API provides access to status information and slicing schedules for one or more Live Slicers. Unlike the Live Slicer API, this API communicates directly with the Slicer, making it useful for monitoring and scheduling tasks.
When to Use the Slicer State API
Use the Slicer State API when you need to:
- Retrieve the last known status information for one or more Live Slicers.
- Get or update slicing schedules.
- Track slicing activity and scheduling remotely.
API Conventions
- Requires authentication.
- Uses GET HTTP methods for retrieving information.
- Uses JSON-formatted request and response bodies.
Key Endpoints
Endpoint | Description |
---|---|
/api2/slicer/status | Retrieves the last known status of one or more Live Slicers. |
/api2/slicer/schedule/get | Retrieves the slicing schedule for a specific Live Slicer. |
/api2/slicer/schedule/update | Updates the slicing schedule for a Live Slicer. |