Batch Deletion with API
Hi, I work at a medical university and we would like to batch delete users who haven't logged on since a specific date. We were informed that an API could help with the batch deletion and referred to an article about APIs. We want to go back to our ITS team and let them know which API specifically would be beneficial for batch deletion and how that would be implemented. Could you help with which API is optimal for our task? Also, how would that be implemented?
Best Answer
-
Kevin Baum Panopto Employee
Hi Fred,
You can use Panopto's public SOAP API to delete a batch of users based on their user IDs. The IUserManagement.DeleteUsers SOAP API endpoint takes in a list of Panopto User IDs and deletes them from Panopto's system when called by a Panopto administrator.
We do not have an API to get a user's last login time, but we offer a system report to retrieve the last login time all users have logged in. Using either the Panopto UI or the IUsageReporting.CreateRecurringReport SOAP API endpoint, you can schedule a report daily, weekly, or monthly to get the last login time for all users on your Panopto site. For more information on how to schedule a report using the Panopto UI, as well as which fields are included in this report, please see our How To Create System Usage Reports support article. We also offer either a SOAP API (IUsageReporting.GetReport) or a REST API endpoint (Get Report) that you can use to download the resulting CSV file after the report has been run.
Putting all of these pieces together, you can schedule a daily or weekly report of user login times, then use the Panopto API to download that report in CSV format. You can then parse and filter the resulting data to find the list of users who have not logged in within your specified time, then call the DeleteUsers SOAP API with those user IDs to delete them automatically.
For help getting started with using our SOAP API, we do offer a public Python sample of using the SOAP API on our GitHub page at https://github.com/Panopto/python-soap..
I hope that this helps. Please let me know if you have any other questions.
Thanks,
Kevin
1