Skip to main content

Watch

warning

For testing only.

This endpoint is a proof-of-concept and not yet in active use.

Watch session data added via this API is not integrated with the rest of the platform.

Watch endpoints replace the upsertWatchHistory mutation.

Summary

When a video is played with an API consumer video player, the API consumer must:

  1. Establish a globally unique watch ID (UUID recommended) to be sent will all request for the watch session;
  2. Send an initial POST /watch/start request;
  3. Send periodic (every 5 seconds recommended) POST /watch/update requests;
  4. Determine at the end of the session if the viewer completed the video; and
  5. Send a final POST /watch/stop request.

POST /watch/start

Purpose

Start a new watch session.

This endpoint should be called each time a video is started in an API consumer video player.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
deviceIdYesStringID of device the watch is happening on.
sessionIdYesStringGlobally unique watch ID (UUID recommended). Must be generated by consumer and used for subsequent requests for the watch session.
startSecondsNoIntegerHow many seconds in to the video the watch is starting from (default: 0).
stationIdYesUUIDID of the station associated with the request.
videoIdYesUUIDID of the video being watched.
viewerIdYesUUIDID of the viewer watching the video.

Responses

Watch session has been started.

POST /watch/update

Purpose

Update the video position of a watch session.

This endpoint should only be called after POST /watch/start to update a known watch session.

Recommended call interval: every 5 seconds.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
deviceIdYesStringID of device the watch is happening on.
currentSecondsYesIntegerCurrent video position (in seconds) of the watch session.
sessionIdYesStringGlobally unique watch ID sent with POST /watch/start.

Responses

Watch session has been updated.

POST /watch/stop

Purpose

Stop a watch session.

This endpoint should only be called after POST /watch/start to stop a known watch session.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
deviceIdYesStringID of device the watch is happening on.
contentCompletedYesBooleanWhether the video watched in the session is considered complete.
currentSecondsYesIntegerFinal video position (in seconds) of the watch session.
sessionIdYesStringGlobally unique watch ID sent with POST /watch/start.

Responses

Watch session has been ended.