Docs home

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).

POST/materials/{resourceId}/viewed
Mark Material as Viewed
curl --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:

BodyJSONString
class_idintegerrequired
Batch (class) ID. Without it the call fails with "You do not have access to this class".
1 if the learner downloaded the file. Skips the minimum-watch check for videos.
infoarray
Legacy field. If its first number is greater than 0, nothing is recorded. Leave it out.

Path: resourceId is the teaching material ID.

Response200application/json
codeinteger
Example: 200
messagestring
Example: View updated successfully
viewobject
Show child attributesHide child attributes
Example: 740092
true if this view completed the course and issued a certificate
Example: false

Notes: 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.

Updated yesterday

Ask AI