cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
riedlm
Community Member

How to automate the provisioning_csv report with canvas lms api using js?

Jump to solution

I got Provisioning section under

Admin-->Settings-->Reports-->Provisioning

I want to automate provisioning using api.

Can any one please suggest me is there any api funtion do this.

1 Solution

Accepted Solutions
dwahl_sales
Instructure
Instructure

Hello  @riedlm ​,

The "Start a Report" API method endpoint will allow you to trigger the CSV provisioning report.

Account Reports - Canvas LMS REST API Documentation

As far as "automating with JS" goes, well, it depends.  If you mean to add it to the Canvas custom JavaScript, well... it's "possible" but highly unrecommended. Basically you would have to write a script that loads for every user on every page and checks:

1) am I an admin?

2) is it time to start the script?

This is bad because 1) that's a lot of checks for nothing 2) if the admin isn't logged in, the automation doesn't kick off and 3) if the admin isn't logged in at the right time, the automation doesn't kick off and 4) if the admin is logged in at a specific time, well they may as well just click the button b/c you're 2/3 of the way there.

However, if you're talking about "automate via JS" with a server, such as a standalone Node.js server- then yes it would work.  It will likely still use some sort of OS-level task handling.  Most people will probably just use the built-in tools available to them to schedule the API call:

  • Task Scheduler (Windows)
  • Crontab (Unix/Linux)
  • LaunchAgent/LaunchDaemon (Mac)

Those are the built-in utilities that say "at X interval do Y" and they're very very flexible.

View solution in original post

2 Replies
Stefanie
Community Team
Community Team

Matthew, because of the technical nature of this question, I've shared it with the Canvas Developers group.

dwahl_sales
Instructure
Instructure

Hello  @riedlm ​,

The "Start a Report" API method endpoint will allow you to trigger the CSV provisioning report.

Account Reports - Canvas LMS REST API Documentation

As far as "automating with JS" goes, well, it depends.  If you mean to add it to the Canvas custom JavaScript, well... it's "possible" but highly unrecommended. Basically you would have to write a script that loads for every user on every page and checks:

1) am I an admin?

2) is it time to start the script?

This is bad because 1) that's a lot of checks for nothing 2) if the admin isn't logged in, the automation doesn't kick off and 3) if the admin isn't logged in at the right time, the automation doesn't kick off and 4) if the admin is logged in at a specific time, well they may as well just click the button b/c you're 2/3 of the way there.

However, if you're talking about "automate via JS" with a server, such as a standalone Node.js server- then yes it would work.  It will likely still use some sort of OS-level task handling.  Most people will probably just use the built-in tools available to them to schedule the API call:

  • Task Scheduler (Windows)
  • Crontab (Unix/Linux)
  • LaunchAgent/LaunchDaemon (Mac)

Those are the built-in utilities that say "at X interval do Y" and they're very very flexible.

View solution in original post