Deletes:
- A schedule entry. Identify a schedule entry by its system-defined ID.
- Optional. If that entry was scheduled as a result of a playlist, then you may also delete all of the other entries that were scheduled at that time.
You may only delete schedule entries that occur in the future. Scheduled entries that occurred in the past cannot be deleted. Attempting to delete the currently active schedule entryIdentifies a schedule entry that is currently serving as the source for the live channel's feed. will truncate it.
Request
Request syntax (single schedule entry):
DELETE /channels/Live Channel ID/schedules/Schedule Entry ID
Request syntax (schedule entry and linked schedule entries):
DELETE /channels/Live Channel ID/schedules/Schedule Entry ID?include_linked=true
Define the following variables 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 |
---|---|
Live Channel ID Required | Identifies a live channel by its system-defined ID. |
Schedule Entry ID Required | Identifies a schedule entry by its system-defined ID. Use the Get Multiple Schedule Entries endpoint to retrieve schedule entries and their system-defined IDs. |
Response
The response for a successful request is a 200 OK and it contains the following properties:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to this endpoint. |
@type | String | Returns Schedule. |
message | String | Returns Deleted when the specified draft has been successfully deleted. |
If a schedule entry cannot be deleted, then the response will have one of the following status codes:
- 400 Bad Request: An invalid request was submitted.
- 403 Unauthorized: A request to delete a current or past schedule entry was submitted.
- 500 Internal Server Error: An unknown error occurred. Check the request and resubmit it.
Sample Request/Response
Call the delete_schedule_entry module (Python 3) to delete a schedule entry. This module imports names from the api_auth module.
import json, requests
from api_auth import APICredentials, APIParams
channel_id = 'Hak3zjnPLSW5o0j8GMpzRMsa' # Replace with the ID for the desired live channel.
schedule_id = '2158c7452b7841158972e019a5bd5f12' # Replace with the ID for the desired schedule entry.
class DeleteScheduleEntry:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
"""
Deletes a schedule entry.
"""
self._delete_schedule_entry()
def _delete_schedule_entry(self):
url = "{}{}{}{}{}".format(self.host, "/api/v4/channels/", channel_id, "/schedules/", schedule_id)
response = requests.delete(
url, params=APIParams(APICredentials()).get_params({})
)
print(response.json())
DeleteScheduleEntry().run()
Response:
{
'@id': '/channels/Hak3zjnPLSW5o0j8GMpzRMsa/schedules/2158c7452b7841158972e019a5bd5f12',
'@type': 'Schedule',
'message': 'Deleted'
}