Trying to get at course completion via APIs

Paul.C.116
Paul.C.116 Posts: 2 🌱
edited October 2023 in Development

I'm trying to get information about course completion for Training classes we're assigning to patrons and for a course for which we have a completion, I'm getting no results:

Here's the path I'm using (pushing in variables we're using):

GET $baseUrl "/d2l/api/le/1.73/" + $orgUnitId +"/grades/courseCompletion/"

The orgUnitId I'm using here is at the Course Offering level. I toyed with doing this at the section level (which is where we're assigning the course via IPSIS), but using that orgUnitId consistently gave me a 403 error.

If I impersonate the manager, I can see that the course is, in fact, completed, but the return from the above GET call yields:

Is there some sort of delay on this showing up in the API calls.

I'm using an OAuth2 connection that was joined up with a Super Admin user. Scopes granted are:

core:*:* courses:*:* datahub:*:* datasets:*:* enrollment:*:* grades:*:* orgunits:*:* reporting:*:* sections:*:* users:*:*

Realize the above is likely overkill, but I'm trying (and also doing other things with these calls)

Tagged:

Answers

  • Chris.S.534
    Chris.S.534 Posts: 379
    edited October 2023

    Hi Paul,

    I've tried using GET /d2l/api/le/(version)/(orgUnitId)/grades/courseCompletion/ using version 1.61 and the call worked successfully - the course had no completion records but the call was successful returning in Postman with a Status 200 OK:

    {    "PagingInfo": {        "Bookmark": null,        "HasMoreItems": false    },    "Items": []}

    A 403 error may indicate the calling user doesn't have the required privileges/role permissions to make the call. However, grade/completion etc are recorded at the Course Offering level.

    Please check the Completion Tracking checkbox in the UI is checked and see how you get on - noting after doing so this will only pick up new completions.

    Hope that helps!

  • Paul.C.116
    Paul.C.116 Posts: 2 🌱

    Thanks Chris…

    It looks like what I'm looking for actually lies in content completions..

    GET /d2l/api/le/(version)/(orgUnitId)/content/completions/

    I think I've got this. A bit annoyed that the above call won't give me paged results, but it is what it is.