September 22, 2023
How to mark user complete for a course via API
Comments
(0)
September 22, 2023
How to mark user complete for a course via API
Followers: 5 people
(0)

Summary:

This article covers API that is used to mark users complete for a course, sample payload, pre-requisites and how to obtain pre-requisites.

Audience:

Integration admin role and administrators of Adobe Learning Manager account.

API endpoints used:

Admin scope  API

POST /users/{userId}/userModuleGrade

Mandatory Pre-requisites to execute the API:

You can skip this step if you already have mandatory details to execute userModuleGrade API.

  1. User ID

  • User for whom the completion should be marked
  • To obtain user ID, you can execute the API: GET /users (Retrieves the list of users for an account)
  1. Course ID

  • Course for which user should receive completion
  • To obtain course ID, you can execute API: GET /learningObjects (Retrieves the details of learning objects)

 

  1. Module ID

  • Courses will have one or more modules (like self-paced, VILT etc.,) which defines for which specific module the learner should be marked complete.
  • To obtain module ID, execute API: GET /learningObjects/{id} (Retrieves the details of a learning object)
  • Include parameter:instances.loResources
  • Enter course ID details obtained from previous API in ‘id’ section in format “course:7968486”. Below is screenshot for reference.

  • You will obtain the module ID “loResources” section in response body:

Sample payload for userModuleGrade API:

{
“data”: {
“type”: “userModuleGrade”,
“attributes”: {
“duration”: 1,
“score”: 20,
“minScore”: 10,
“maxScore”: 20,
“dateCompleted”: “2023-09-20T09:36:36.000Z”,
“dateSuccess”: “2023-09-20T09:36:36.000Z”,
“dateStarted”: “2023-09-19T09:35:57.000Z”,
“started”: true,
“completed”: true,
“success”: true
},
“relationships” : {
“learner” : {
“data” : [
{
“id”:”13230830″,
“type”: “user”
}
]
},
“module” : {
“data” : [
{
“id”:”7968486132104870″,
“type”: “courseModule”
}
]
},
“course” : {
“data” : [
{
“id”:”7968486″,
“type”: “course”
}
]
}
}
}
}

Basic Navigation steps for reference:

Step 1: Login as integration admin of the ALM account > Developer Resources > API References

Step 2: Authorize admin read and write.

Step 3: Navigate to APIs you want to execute as shared in earlier steps

0 Comments
Add Comment