Live Event Status Reporting
Receive HTTP notifications describing a live event's state changes, with authentication and payload reference.
Major events (e.g., creating, starting, and stopping a live event) are tracked for each live event. Our service can report these events as JSON data to a web server through HTTP POST requests. Your web server may then log this data and perform custom actions in response to specific types of events.
Post a Live Event's Status Information to Your Web Server
-
Navigate to the Live Events page.
- From the main menu, navigate to Settings > Live Events.
-
Under the Event Callback URL section, type the URL to which HTTP POST requests will be submitted.
-
Optional: Choose how you will authenticate requests posted to your web server under the Webhook Secret Token section.
-
No Authentication: Verify that None is selected.
-
Token or Signature Authentication: Perform the following steps:
- Token Authentication:
- Select X-Edg-Auth-Token.
- This mode ensures that each live event status request sent from our service to your web server includes an
X-Edg-Auth-Tokenheader set to your secret key.
- Signature Authentication:
- Select X-Edg-Signature-256.
- This mode ensures that each live event status request sent from our service to your web server includes an
X-Edg-Signature-256header set to an encrypted value that represents the request's payload.
- Token Authentication:
-
Click Generate Secret.
-
Click Copy.
-
Store your secret key in a secure location.
-
Access to a secret key is limited to when it is generated. If you lose your secret key, you will need to generate a new one and update your server-side authentication script to reference it.
-
Click Ok.
-
-
Click Test to submit a test request to your web server. Verify that your web server received the request.
-
Click Save.
Authentication
Verify that a request came from our service through either of the following authentication methods:
-
Token: This mode requires our service to include the
X-Edg-Auth-Tokenheader with each request it sends to your web server. This header is set to your secret key. You will need to implement a server-side script that compares your secret key to theX-Edg-Auth-Tokenheader.Sample validation function
SECRET = '1234567890abcdefghijklmnop' # Replace with your secret key. ... def validate_authentication_token(self, content, callback): header_sig = self.headers.get(TOKEN_TYPE_AUTH_TOKEN) if SECRET == header_sig: callback(content, TOKEN_TYPE_AUTH_TOKEN) -
Signature: Recommended. This mode requires our service to include the
X-Edg-Signature-256header with each request it sends to your web server. This header is set to a signature that is calculated by encrypting the request's payload using a hash-based message authentication code (HMAC-SHA256) and your secret key. You will need to implement a server-side script that calculates this signature and compares it to theX-Edg-Signature-256header.Sample validation function
SECRET = '1234567890abcdefghijklmnop' # Replace with your secret key. ... def validate_signature_256(self, content, callback): msg = b64encode(zlib.compress(content.encode('utf8'), 9)).strip() sig = hmac.new(SECRET.encode('utf-8'), msg, hashlib.sha256).hexdigest() header_sig = self.headers.get(TOKEN_TYPE_SIGNATURE_256) if sig == header_sig: callback(content, TOKEN_TYPE_SIGNATURE_256)
Below is sample code that instantiates a sample web server and contains functions through which you authenticate a token or a signature:
Request Body
The HTTP POST request body will contain the following properties:
| Property | Type | Description |
|---|---|---|
| event | String | Describes the event that took place.Learn more. |
| event_desc | String | Identifies a live event by its description. |
| event_id | String | Indicates the system-defined ID for the event that took place. |
| external_id | String | Identifies the asset associated with this event by its external ID. |
| metadata | Object | Contains a key-value pair for each metadata field associated with the event. |
| state | String | Indicates the state of the live event at the point in time at which the event took place. Valid values are: pre | live | resume | post | completeLearn more. |
| testing_complete | Integer | Indicates the date and time at which live event testing was completed. A null value is reported when live event testing had not been completed at the point in time at which the event took place. |
| testing_start | Integer | Indicates the date and time at which live event testing was started. A null value is reported when live event testing had not been started at the point in time at which the event took place. |
| timestamp | Integer | Indicates the date and time, in Unix time (milliseconds), at which the event took place. |
| user_id | String | Indicates the system-defined ID associated with the user account that triggered the event. Find user ID:
|
| username | String | Indicates the email address associated with the user account that triggered the event. |
State
Live event states are defined below.
| Value | Description |
|---|---|
| pre | Indicates that the live event had not started. |
| live | Indicates that the live event was in progress. |
| resume | Indicates that the both of the following conditions were true:
|
| post | Indicates that the live event had completed and post-processing (e.g., creating on-demand content from a live event) was initiated. |
| complete | Indicates that the live event had completed and all post-processing tasks were completed. |
Events
Events are defined below.
| Value | Description |
|---|---|
| Added Metadata | Indicates that metadata was added to a live event. |
| Added Slicer | Indicates that a Live Slicer was added to a live event. |
| Added Test Player | Indicates that a test player was added to a live event. |
| Auto Event Mode Cancelled | Indicates that a live event's auto start/stop mode was turned off. |
| Auto Event Schedule Cleared | Indicates that a live event's scheduled start/stop time was cleared. |
| Auto Event Slicer Scheduling Error | Indicates that there was an issue scheduling a Live Slicer for a live event that was configured to automatically start. |
| Completed Test | Indicates that an operator completed testing a live event. |
| Error Scheduling Slicers For Auto Stop | Indicates that there was an issue scheduling one or more Live Slicer(s) for a live event that was configured to automatically stop. |
| Event Copied from {Event ID} | Indicates that a live event was duplicated from an existing live event. The term {Event ID} identifies the ID of the live event that was copied. |
| Event Created | Indicates that a live event was created. |
| Event Deleted | Indicates that a live event was deleted. This deletion may have been performed manually or automatically upon its expiration. |
| Event Ended | Indicates that an operator ended a live event. |
| Event Ended: Resume Available | Indicates that an operator ended a live event that could have been resumed. |
| Event Marker Set: {Marker Type}:{Marker Name} | Identifies the marker that was applied to the live event. |
| Event Resumed | Indicates that an operator resumed a live event. |
| Event Started | Indicates that an operator started a live event. |
| Event Updated | Indicates that a live event was updated. |
| Event VOD over max duration (8 hours) | Indicates that a live event's duration exceeded 8 hours and therefore resulted in the creation of multiple CMS assets.
|
| Started Test | Indicates that an operator started testing a live event. |
| Switched to Source | Indicates that the audio/video feed was switched over to different source content via the Switcher pane. The term Source identifies the live event's new source (i.e., Live Slicer, ad, and slate). Non-Slate Syntax: Switched to {Source}Slate Syntax: Switched to slate [in VOD] {Mid-Event Slate Asset}Learn more. |
| VOD Asset Auto-Expired | Indicates that an expired CMS asset was deleted. |
| VOD Asset Deleted | Indicates that a CMS asset was manually deleted. |
| VOD Available | Indicates that a CMS asset containing the audio/video feed for a completed live event was created. |
Sample Request Body
Updating a live event configuration will trigger Live Event Status Reporting. A sample request body for this type of event is provided below.
{
"username": "[email protected]",
"user_id": "abcdefghijklmnopqrstuvwxyz123456",
"external_id": "",
"event_id": "1d6f7eb5fe474312947e73ccc1c57e32",
"timestamp": 1572293065429,
"event_desc": "My Live Event",
"state": "pre",
"testing_complete": null,
"testing_start": null,
"event": "Event Updated",
"metadata": {
"key2": "value2",
"key1": "value1"
}
}Updated 2 days ago