Docs home

Get User Teaching Material Views

Lists every time one learner opened a teaching material in a batch, including views that were later reset. Use it to see how many views a learner has used up on a material with a view limit, and to get the view `id` you need for "User Teaching Material View Reset".

GET/materials/{materialID}/viewslist
Get User Teaching Material Views
curl --request GET \
  --url 'https://<your-api-host>/nuSource/api/v1/materials/{materialID}/viewslist?student_id=<userId>&class_id=<classId>' \
  --header 'APIKEY: <your-api-key>' \
  --header 'ORGID: <your-org-id>'
{
  "code": 200,
  "message": "Success",
  "viewsInfo": [
    {
      "id": 6960,
      "view_date": 1739772363,
      "is_material_view_reset": 0,
      "view_reset_at": null,
      "view_reset_by": null
    }
  ]
}

Access: Any signed-in user of your organization. The route has no role restriction.

Path parameters
materialIDintegerrequired
Teaching material ID. Must belong to your institute, otherwise you get "Not Authorized".
Query parameters
student_idintegerrequired
Learner's user ID.
class_idintegerrequired
Batch (class) ID the views were recorded in.
Response200application/json
codeinteger
Example: 200
messagestring
Example: Success
viewsInfoobject[]
Show child attributesHide child attributes
View record ID
Example: 6960
Unix timestamp
Example: 1739772363
1 if the view was reset and no longer counts, else 0
Example: 0
Unix timestamp or null
Name of the user who reset it, or null

Notes: An empty array means the learner never opened the material in that batch. Rate limit: 30 requests per 1 minute; going over locks you out for 30 minutes.

Updated yesterday

Ask AI