Skip to main content
Skip table of contents

Update events

Overview

OpenTV Video Platform supports updating of live events – that is, replacing existing events with different ones. This can be done in two ways:

These are explained in the following sections.

Updating events via a CPM API call

When you make an API call to CPM to replace events in a specified timeslot:

  1. CPM checks whether any of the specified events overlap with:

    • The start or end times of the specified timeslot
    • Each other

    If they do, the request fails.

  2. CPM checks if any of the events in the request already exist in the schedule for the specified timeslot. Then:
    • If an event specified in the request matches one that already exists in the schedule for the timeslot, CPM updates the event.
    • If there is no matching event in the schedule for the timeslot, CPM creates it.
    • If an existing event in the schedule for the timeslot does not match any in the request:
      • If the event overlaps the start time of the timeslot, CPM changes its end time to the timeslot start time.
      • If the event overlaps the end time of the timeslot, CPM changes its start time to the timeslot end time.
      • If neither of these is true, CPM removes the existing event from the schedule.
    • If no events exist for the specified timeslot, CPM creates all the events specified in the request.

For example:

Here, CPM:

  • Changes the end time of event A because it overlaps the start of the specified timeslot.
  • Changes the start and end times of event B because it already exists in the schedule within the specified timeslot.
  • Removes event C because it does not exist in the request.
  • Adds event E because it exists in the request but not in the schedule.

Request

To update live events, send a PUT request to:

https://<host>:<port>/cpm/content/v1/channelSetEvents

Headers

  • Content-Type: application/json

Mandatory arguments

  • channelEventSet – the body must include one channelEventSet that contains one or more blocks, one for each channel.
  • editorialChannelRef – a block that identifies an editorial channel. You must specify either:
    • id – the reference public ID of the channel, or
    • providerId and providerResourceId – the reference provider ID and reference provider resource ID of the channel
  • startFrom  – the start time of the slot in which events will be replaced (in ISO 8601 format up to and including seconds but without time zone)
  • endUntil – the end time of the slot in which events will be replaced (in ISO 8601 format up to and including seconds but without time zone)
  • eventSet – within the editorial channel block, there must be one eventSet block that contains the set of new events that will replace the existing events in the specified timeslot. This set must contain at least one event.

Other arguments

Each event in the eventSet can include many arguments – see PUT /channelSetEvents in the CPM content API documentation .

Example

A PUT request with this payload replaces the event(s) in the specified timeslot with the specified event (according to the rules explained above):

CODE
{
	"channelEventSet": [{
			"editorialChannelRef": {
				"id": "ch01"
			},
			"startFrom": "2020-12-25T18:00:00Z",
			"endUntil": "2020-12-25T19:00:00Z",
			"eventSet": [{
					"editorialContentRef": "9798545",
					"timeShifting": {
						"shortTermCatchUpSupport": true,
						"longTermCatchUpSupport": false,
						"startOverSupport": true,
						"networkPvrSupport": false
					},
					"id": "9798545-ARN116348427",
					"providerId": "TVCO",
					"providerResourceId": "9798545-ARN116348427",
					"name": "The Ellen DeGeneres Show /S18 /E12",
					"start": "2020-12-25T18:00:00Z",
					"end": "2020-12-25T19:00:00Z",
					"airingStartTime": "2020-12-25T18:00:00Z",
					"airingEndTime": "2020-12-25T19:00:00Z",
					"metadataSet": [{
							"locale": "en_GB",
							"metadata": [{
									"key": "Title",
									"value": "The Ellen DeGeneres Show"
								},
								{
									"key": "Synopsis",
									"value": "Ellen DeGeneres returns with unparalleled celebrity interviews, musical performances, topical stories, extraordinary human interest guests, and sought-after viral sensations."
								},
								{
									"key": "Description",
									"value": "Ellen DeGeneres returns with unparalleled celebrity interviews, musical performances, topical stories, extraordinary human interest guests, and sought-after viral sensations"
								},
								{
									"key": "Episode",
									"value": "Jurnee Smollett"
								}
							]
						},
						{
							"locale": "none",
							"metadata": [{
									"key": "Rating",
									"value": "PG"
								},
								{
									"key": "DvbCategories",
									"value": "0:0:2:9"
								},
								{
									"key": "Year",
									"value": "2020"
								},
								{
									"key": "Language",
									"value": "eng"
								},
								{
									"key": "Countries",
									"value": "US"
								},
								{
									"key": "Actors",
									"value": "Ellen DeGeneres"
								},
								{
									"key": "Categories",
									"value": "TV SHOWS - REALITY"
								},
								{
									"key": "ContentType",
									"value": "TV_EPS"
								},
								{
									"key": "Definition",
									"value": "SD"
								},
								{
									"key": "Colour",
									"value": "Colour"
								},
								{
									"key": "AudioMode",
									"value": "Stereo"
								},
								{
									"key": "Aspect",
									"value": "Widescreen"
								},
								{
									"key": "Subtitles",
									"value": ""
								},
								{
									"key": "SOCU_filename",
									"value": "ARN116348427/1602076113/2678/manifest"
								}
							]
						}
					]
				}
			}
		}
	]
}

Response

A successful request returns an HTTP 200 status and a link to the event(s).

A bad request returns an HTTP 400 status.

See also

For full details of this API, see the CPM content API documentation.

Updating events by ingesting

You can update events by ingesting the new events in the usual way. The rules for how the new events are handled are the same as for Updating events via a CPM API call, above.

When ingesting, you can specify a timeslot, but it is not mandatory. If you do not specify a timeslot, the timeslot is taken to be from the start time of the first event (chronologically) to the end time of the last event.

To specify a timeslot, include startFrom and endUntil attributes on the channelEvents element. For example:

CODE
<channelEvents startFrom="2020-03-28T16:00:00Z" endUntil="2020-03-31T16:00:00Z">
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.