Question

Has anyone automated unenrolling terminated users from courses that are not completed?


Userlevel 5
Badge +1

Hello Docebians and Docebo friends!

We need to have an automated process to unenroll terminated users from any courses they are enrolled in except for completed ones.  Has anyone solved how to do this or is this still a manual effort?


12 replies

Userlevel 7
Badge +7

hmm, you might need to look at using API’s do this kind of work if your volumes are high.

Userlevel 3
Badge

I will be following this post since we have a need to do the same for users that need to be removed from courses when their subscription expires but still need to be able to have access to our free content (can’t just expire the user). 

Userlevel 5
Badge +1

@lrnlab Thank you, I assumed that would be the case.  Do you know which API or combination of API’s would be used, and possibly the workflow behind the construct of these?  I don’t have any API experience personally, and we are searching for an API resource internally.  If I can get the information to say this is what we need to do that would go a long way in getting the automation in place.

Sure would be nice if there was a rule we could just enable...

Userlevel 7
Badge +3

I do a process very similar to this with a combination of reports and api. It is for removing users from iLT who did not attend each day so that they can just enroll in another session easily. The report runs to get the users you are looking for, in this case I’d prob make a group of leaving users in their off boarding process, so the report only looks at currently gone users, and pulls their source enrollment status. A filter for only those not competed (could do this externally or by running two reports, one for in progress, one for not started and then merge them) and then it is a matter of manipulating that data into an array in the right format for the batch enrollment endpoint but passed as a delete to remove them. In this way you can do a couple hundred per call instead of one at a time, which helps manage the api hourly limits, but will have to manage the amount you are putting into each call. The reason I start with reports is also to manage api usage, you could do it all with apps, looking up each users enrollments and then filtering and merging to a larger list. 

Userlevel 5
Badge +1

I do a process very similar to this with a combination of reports and api. It is for removing users from iLT who did not attend each day so that they can just enroll in another session easily. The report runs to get the users you are looking for, in this case I’d prob make a group of leaving users in their off boarding process, so the report only looks at currently gone users, and pulls their source enrollment status. A filter for only those not competed (could do this externally or by running two reports, one for in progress, one for not started and then merge them) and then it is a matter of manipulating that data into an array in the right format for the batch enrollment endpoint but passed as a delete to remove them. In this way you can do a couple hundred per call instead of one at a time, which helps manage the api hourly limits, but will have to manage the amount you are putting into each call. The reason I start with reports is also to manage api usage, you could do it all with apps, looking up each users enrollments and then filtering and merging to a larger list. 

@Bfarkas Could you please help me more with this process? I’m also looking for a similar way to unenroll the users from the closed sessions/events. I tried with APIs, but I can achieve it for only single users. I’m looking for an API support, where I can unenroll the multiple users from the multiple sessions through APIs. Appreciate your helps.

Userlevel 7
Badge +3

I do a process very similar to this with a combination of reports and api. It is for removing users from iLT who did not attend each day so that they can just enroll in another session easily. The report runs to get the users you are looking for, in this case I’d prob make a group of leaving users in their off boarding process, so the report only looks at currently gone users, and pulls their source enrollment status. A filter for only those not competed (could do this externally or by running two reports, one for in progress, one for not started and then merge them) and then it is a matter of manipulating that data into an array in the right format for the batch enrollment endpoint but passed as a delete to remove them. In this way you can do a couple hundred per call instead of one at a time, which helps manage the api hourly limits, but will have to manage the amount you are putting into each call. The reason I start with reports is also to manage api usage, you could do it all with apps, looking up each users enrollments and then filtering and merging to a larger list. 

@Bfarkas Could you please help me more with this process? I’m also looking for a similar way to unenroll the users from the closed sessions/events. I tried with APIs, but I can achieve it for only single users. I’m looking for an API support, where I can unenroll the multiple users from the multiple sessions through APIs. Appreciate your helps.

Can you provide any insight into what you have done already? Which endpoint are you using, a sample payload? Always easier to start where you are than to assume and recreate from scratch. There are some bulk endpoints that allow you to send arrays of requests, I generally keep them still to one course per endpoint but you don’t necessarily have to, was just easier with my setup.

Userlevel 5
Badge +1

I just tried this end point.. Un-Enroll user in ILT & it works.

Delete: /learn/v1/enrollment/{id_course}/{id_user}/session/{id}

 

I’m missing something manipulating the data into an array in the right format. Attached screenshot. I tried for a batch unenroll endpoint, it works well as a single user but doesn’t as a multiple users. 

Userlevel 7
Badge +3

Ah, that's a single action endpoint, you want a bulk.
https://nyl.docebosaas.com/api-browser/#!/learn/Enrollment/Enrollment_learn_v1_enrollments
I know those links don’t work well, its in the api-browser under Learn > Enrollment > Un-enroll users in course(s)

Its a DELETe with URL of /learn/v1/enrollments

The body takes the format of:
{
  "user_ids": [
    0
  ],
  "course_ids": [
    0
  ],
  "learningplan_ids": [
    0
  ],
  "reset_tracks": true,
  "cascade_unenroll_from_courses_in_selected_learning_plan": true,
  "delete_issued_certificates": true
}

 

You don’t need all of the above, but you can see how you can list all the users and remove those users from multiple courses and learning plans in one go.

Userlevel 5
Badge +1

@Shanon  - May you add this to the list of API explorations with Adam.  Can leverage this for unenrolling of terminated users from the compliance courses

Userlevel 5
Badge +1

Ah, that's a single action endpoint, you want a bulk.
https://nyl.docebosaas.com/api-browser/#!/learn/Enrollment/Enrollment_learn_v1_enrollments
I know those links don’t work well, its in the api-browser under Learn > Enrollment > Un-enroll users in course(s)

Its a DELETe with URL of /learn/v1/enrollments

The body takes the format of:
{
  "user_ids": [
    0
  ],
  "course_ids": [
    0
  ],
  "learningplan_ids": [
    0
  ],
  "reset_tracks": true,
  "cascade_unenroll_from_courses_in_selected_learning_plan": true,
  "delete_issued_certificates": true
}

 

You don’t need all of the above, but you can see how you can list all the users and remove those users from multiple courses and learning plans in one go.

@Bfarkas Super Duper!!! It works. Thanks for your kind support… Is there any best practice to maintain or get the backend User ID? (Currently I’m using Inspect or F12 option and get backend User Id from network tab) 

Userlevel 7
Badge +3

There’s a bunch of methods, really comes down to what you’re doing. It’s available in reports if you want to get bulk amounts and automate it a bit, there’s info for how to get it a few ways in the front end here: 

 

there’s also just the standard get user info api call that you can go through and look them up, you can find this in your api browser as well. 

Userlevel 4

Interesting, I’m glad you asked the question. We have a training path that has a lot of turmoil. I am trying to develop Postman/API scripting skills. It is going very slow at the moment.

Reply