Course completion API not returning results?

I'm trying to retrieve course completion information via Postman.
- GET {{BrightspaceDomain}}/d2l/api/le/{{leversion}}/1234/grades/courseCompletion/
- GET {{BrightspaceDomain}}/d2l/api/le/1.75/grades/courseCompletion/12345/
Each time I run the GETs above, I get a 200 status, but it doesn't return any details:
{"PagingInfo": {"Bookmark": null,"HasMoreItems": false},"Items": []}
I double-checked a Manager Completion report, and user 12345 definitely appears in a completion report for course 1234. Can anyone point out what I'm missing? I'm a novice when it comes to APIs.
Some notes:
- Course 1234 didn't get "enable completion tracking" turned until yesterday.
- The completion tracking criteria is based on the release condition "User has earned award X"
- I also tried this on multiple other courses and users who should be marked as complete, but still aren't appearing in the response
Best Answer
-
I ended up submitting a ticket, and it turns out it's not user error (phew!)
I have tested the course completion APIs on our internal sites and have confirmed that we are also receiving null responses. After investigating, we have identified gaps in these APIs, and the course completion APIs are not connected as intended.
Specifically, the following API routes are affected:
GET /d2l/api/le/(version)/(orgUnitId)/grades/courseCompletion/
GET /d2l/api/le/(version)/grades/courseCompletion/(userId)/
Therefore, we recommend using the new API route for course completion:
/d2l/api/lp/(version)/enrollments/orgUnits/(orgUnitId)/users/(userId)/completion
Answers
-
I haven't used this route before, but I suspect that it is specific to the Grades tool, which is separate from the "completion tracking" setting.
This route may perform the action that you're looking for. I was able to collect the completion status of a user. Some notes about the route:
- The authorizing user will require Completion Tracking permissions. I enabled them all, but I suspect it is "Track Completion Progress in Widget," but others may also impact it.
- Completion Tracking is required to be enabled in the target org unit.
Hope this helps!
-
Interesting idea - but it's still not working!
- I ran GET {{BrightspaceDomain}}/d2l/api/lp/{{lpversion}}/enrollments/orgUnits/7105/users/19503/completion and it gives me a 404 error. (I tried multiple orgunitids and userids)
- But if I look up the same user via GET {{BrightspaceDomain}}/d2l/api/lp/{{lpversion}}/enrollments/users/19503/orgUnits/ it shows me that they ARE enrolled in OrgUnitId 7105. 🤔
7105 isn't formally assigned by a manager. The user self-enrolled via the Discover tool, but has met the completion criteria for the course.
Some notes/thoughts:
- I'm a Super Admin - I should be able to pull user data, right? This API isn't limited to the manager's of the employees?
- Our courses don't use the grade tools - just the Completion Criteria. (E.g. Our release conditions are based on "User 1 has earned X% on Exam A" and, "User 1 has earned Award B. Award B is our definition of complete."
-
@Maureen.B.923 Is your LP version variable equal to 1.49? That is (currently) the only supported version. 404 means that the route you're trying to query isn't recognised, not that the information that you provided is incorrect.
-
That solved the LP calls! Thanks so much!
Unfortunately the calls that use LE are still returning blank results (despite me updating the LE version value).
I see completion data for:
GET {{BrightspaceDomain}}/d2l/api/lp/{{lpversion}}/enrollments/orgUnits/7105/users/19503/completion
But I don't see that same information when I call:
GET {{BrightspaceDomain}}/d2l/api/le/{{leversion}}/7105/grades/courseCompletion/ (I get a 200 success, but the blank results)