Skip to main content

Videos

info

Admin APIs require authorization token with admin privileges. You check the following link to generate an authorization token. You need to provide an admin username and password to generate token with admin privileges.

Authentication

The Video API allows admin to access and read all videos.

Get Watched Videos of User

This endpoint can be used to retrieve the videos watched by a particular user.

HTTP Request

GET /api/v2.5/admin/users/<id>/videos_watched/

URL Parameters

ParameterDescription
idUnique Id of the user

Query Parameters

ParameterTypeDescription
start_datestringStart date in the format yyyy-mm-dd
end_datestringEnd date in the format yyyy-mm-dd
coursestringUnique course ID
chapterstringUnique chapter ID

Example:

/api/v2.5/admin/users/10/videos_watched/?start_date=2023-12-29&end_date=2024-05-29&course=14

This endpoint will get the list of videos watched by user with ID 10 from the course with ID 14 from December 29, 2023, to May 29, 2024.

curl --request GET \
--url http://demo.testpress.in/api/v2.5/admin/users/60386/videos_watched/
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw' \
--header 'cache-control: no-cache'

Response

{
"count": 2,
"next": "https://lmsdemo.testpress.in/api/v2.5/admin/users/60386/videos_watched/?page=2",
"previous": null,
"per_page": 20,
"results": [
{
"id": 3651,
"title": "Rad1",
"watched_duration": null,
"total_duration": null,
"created": "2024-05-09T12:25:13.267531+05:30",
"watched_percentage": 0,
"remaining_duration": null,
"course_title": "UPSC Course",
"chapter_name": "Radical",
"content_created_date": "2024-04-24T14:08:11+05:30"
},
{
"id": 3689,
"title": "Video 6",
"watched_duration": "12 seconds",
"total_duration": "30 seconds",
"created": "2024-05-28T11:39:06.034546+05:30",
"watched_percentage": 40,
"remaining_duration": "18 seconds",
"course_title": "Orange Muttai 1",
"chapter_name": "Video",
"content_created_date": "2022-12-01T17:28:07+05:30"
}
]
}