Mark Material as Viewed
Records that the learner has viewed a teaching material in a batch. This is what counts the material as completed for course progress. Call it when the learner finishes the material (for videos, after they have watched enough of it).
/materials/{resourceId}/viewedcurl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/materials/{resourceId}/viewed' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={"class_id":"222610"}'{
"code": 200,
"message": "View updated successfully",
"view": {
"material_id": "740092",
"certificate_generated": false
}
}Access: Any signed-in user, but the caller must have access to the batch as a learner.
Request body: form-data with one field, JSONString, containing this JSON:
JSONString1 if the learner downloaded the file. Skips the minimum-watch check for videos.Path: resourceId is the teaching material ID.
200View updated successfullyShow child attributesHide child attributes
740092true if this view completed the course and issued a certificatefalseNotes: For videos, the learner must have watched at least the institute's completion percentage (default 30%, with about a 60-second allowance), otherwise "Not allowed, please watch at least till threshold.". If the material has a view limit and it is used up, you get "Maximum views exceeded for this material.". The first view of a material can trigger the course-progress webhook, certificate generation and product-completion notifications. Errors: "Invalid class or material". Rate limit: 30 requests per 1 minute; going over locks you out for 30 minutes.