View User Video Metrics

An overview of the View User Video Metrics endpoint.

Endpoint Description

The View User Video Metrics endpoint provides detailed information about the videos watched by a specific user within a specific company. This data is essential for tracking user engagement with video content and understanding viewing patterns.

HTTP Method

GET /api/v1/view-user-video-metrics/{userId}/{page}/{limit}

Headers

  • Content-Type: application/json - Specifies that the request body format is JSON.

  • Accept: application/json - Indicates that the client expects a JSON response.

  • Authorization: Bearer {token} - A valid Bearer token must be provided to authenticate the request.

URL Parameters

  • userId (integer): The unique identifier for the user. This parameter is required to specify which user's video metrics are being queried.

  • page (integer): The current page number in the pagination sequence. This parameter helps in retrieving a specific set of results.

  • limit (integer): The number of records to retrieve per page. This parameter helps in controlling the volume of data returned.

Data Dictionary for Response Fields

The response for the "View User Video Metrics" endpoint includes detailed information about each video watched by the user. Below is a breakdown of each field in the response data:

  • video_log_id (integer): R1 unique identifier for the video log.

  • video_url (string): The URL to access the video via the Remote Login Token for integration via an iFrame.

  • user_id (integer): The ID of the user that accessed the video.

  • video_title (string): The title of the video.

  • start_time_stamp (string): The date/time the video session was started.

  • completion_time_stamp (string): The date/time the video session was completed.

  • watched_percentage (string): The percentage of the video that was watched in this session.

  • watched_duration (string): The number of seconds of the video that were watched in this session.

Request Examples

curl --request GET \
    --get "https://api.r1learning.com/api/v1/view-user-video-metrics/1/1/50" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"

Response Examples

{
  "error": 0,
  "message": "",
  "userId": 3862,
  "page": 2,
  "limit": 1,
  "data": {
    "video_metrics": [
      {
        "video_log_id": 6,
        "video_url": "https://discover.r1learning.com/video-library/video/play?video_url=https://video.r1learning.com/topics/phases-of-addiction/TopicVideo.mp4&auth_token=[REMOTE_LOGIN_TOKEN]&user_id=[USER_ID]",
        "user_id": 3862,
        "video_title": "Stand alone video play",
        "start_time_stamp": "2024-01-08 09:10:18",
        "completion_time_stamp": "2024-01-08 09:12:42",
        "watched_percentage": "100.00",
        "watched_duration": "134.698666"
      }
    ]
  }
}

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the user video metrics data.

  • Response Handling: Paginate responses to manage data effectively, especially when dealing with large datasets.*

Last updated