Scheduling Activation/Deactivation of an SEP Stream

With the JobStartStop endpoint, you can schedule the activation and deactivation of an existing live SEP. At the specified time, our system will make the necessary API calls to activate and de-active a Job on your behalf.

Requirements

  • The Live API key for your account.
  • Your live account must have the scheduler override enabled.
  • An existing Live Job with "static": true (see Static Entry Point Jobs for more information).

Create a scheduler

Let's say we want to schedule a 2 hour event that will start at 2021-04-02T14:00:00+00:00.

Timestamps must be in UTC formated as unix timestamp in seconds. You can use https://www.unixtimestamp.com/ for conversion.

To implement the scheduler, make the following POST request:

https://api.bcovlive.io/v1/scheduler/jobstartstop

Headers

Content-Type: application/json
		X-API-KEY: {your API Key}

Request body

{
			"job_id": "your Job ID",
			"activation": {
				"time_utc": 1617386100
			},
			"deactivation": {
				"time_utc": 1617393600
			},
			"description": "My Wednesday broadcast"
		}

Sample response

{
	"account_id": "1752604059001",
	"activation": {
		"state": "pending",
		"time_utc": 1617386100
	},
	"deactivation": {
		"state": "pending",
		"time_utc": 1617393600
	},
	"description": "My Wednesday broadcast",
	"job_id": "15981d93877e490185e6ebc9af2c79a3",
	"type": "jobstartstop",
	"workflow_id": "d44cf29f4f184757ac0995beb8a0097e"
}

Update a scheduler

You can update the activation and/or deactivation time for a scheduler provided that the job is in a pending state ("state": "pending"). To do this, send a PUT request to:

https://api.bcovlive.io/v1/scheduler/jobstartstop/{workflow_id}

The headers are the same as for the POST request shown above.

Request body

In the request body object, include only the activation and/or deactivation fields.

For example, to stop the event 30 minutes earlier than scheduled:

Request body

{
	"deactivation": {
		"time_utc": 1617391800
	}
}

Sample response

{
	"account_id": "1752604059001",
	"activation": {
		"state": "pending",
		"time_utc": 1617386100
	},
	"deactivation": {
		"state": "pending",
		"time_utc": 1617391800
	},
	"description": "My Wednesday broadcast",
	"job_id": "15981d93877e490185e6ebc9af2c79a3",
	"type": "jobstartstop",
	"workflow_id": "d44cf29f4f184757ac0995beb8a0097e"
}

Cancel a scheduler

You can cancel the activation and deactivation with a DELETE request:

https://api.bcovlive.io/v1/scheduler/jobstartstop/{workflow_id}

You can also do this after activation to just cancel the deactivation.

Headers

The only required header is:

X-API-KEY: your API Key

Request body

There is no request body for this request.

Sample response

{
		"account_id": "1752604059001",
		"activation": {
			"state": "cancelled",
			"time_utc": 1617386100
		},
		"deactivation": {
			"state": "cancelled",
			"time_utc": 1617391800
		},
		"description": "My Wednesday broadcast",
		"job_id": "15981d93877e490185e6ebc9af2c79a3",
		"type": "jobstartstop",
		"workflow_id": "d44cf29f4f184757ac0995beb8a0097e"
	}

Notifications

You can optionally configure notifications when creating the workflow. You need to provide a URL for our service to POST to. We will send a notification when the scheduler makes the activation and deactivation calls. You can also configure to receive a notification n seconds before the activation and/or deactivation. See the Live Scheduler Notifications for more details.

Sample request body

{
		"job_id": "your Job ID",
		"activation": {
			"time_utc": 1612274100,
			"notification": 600
		},
		"deactivation": {
			"time_utc": 1612281600,
			"notification": 600
		},
		"description": "My Tuesday broadcast",
		"notification_url": "https://example.com/live/jobstartstop/callbacks"
	}