Skip to main content

GET Live Viewers

Overview


The following table contains important information about the GET method for retrieving live viewer analytics.

GET Live Viewers
MethodGET
URL or Endpoint/api/v2/projects/projectId/analytics/liveViewers
HeadersAuthorization
ParametersvideoId, endDate, seconds, intervalLength, isLive, projectId
BodyNot Applicable

The following table describes the URL parameter for projectId:

projectId URL Parameter
URL Parameter NameprojectId
MandatoryYes
Typestring
DescriptionUnique identifier for the project.

The table below provides details about each query parameter:

Parameter NameMandatoryTypeDescription
videoIdYesstringUnique identifier of the video.
endDateNostring($date-time)The end date for the analytics data you wish to retrieve.
secondsNointeger($int32)The number of seconds for which to retrieve analytics data.
intervalLengthNointeger($int32)The length of the interval for which the analytics data is aggregated.
isLiveNobooleanA boolean indicating whether the video is live.
projectIdYesstringThe unique identifier for the project.

Request Body

This GET request does not contain a request body.

Response

{
"success": true,
"errors": [],
"messages": [],
"result": {
"liveViewers": [
{
"uniqueViewers": 1,
"date": "2024-08-16T11:49:15"
},
{
"uniqueViewers": 1,
"date": "2024-08-16T11:49:30"
}
],
"total": 1
},
"resultInfo": null,
"statusCode": 200
}

Information about the fields that appear when you receive the response are displayed in the table below.

Field NameTypeDescription
successbooleanIndicates whether the request was successful.
errorsarray[]A list of errors that occurred during the request.
messagesarray[]A list of messages returned by the backend.
resultarray[Object]An array containing the analytics result data.
uniqueViewersinteger($int32)The number of unique viewers.
datestring($date-time)The date and time of the analytics data.
resultInfostringAdditional information about the result.
statusCodeinteger($int32)The HTTP status code of the response.

If the action is successful, the service sends back an HTTP 200 or 201 response.

Errors

For information about the errors that are common to all actions, see Common Errors:

  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Result Not Found
  • 500: Internal Server Error
  • 503: Backend Fetch Failed