Scheduled Tasks
This page describes how to create a scheduled task in Windows that will automatically send files to Equity Analytics on a daily basis. This makes use of the external api, so you will need to generate an api token, as well.
This is typically used to keep Equity Analytics updated with your SMS. Changes to students, teachers, schedules, etc. can be kept in sync on a daily basis.
Pre-Requisites
Before continuing forward, you will need to have done the following:
- Set up the CAC Agent to download files to a computer in your district.
- Generated an api token for Equity Analytics.
Files in a directory downloaded via the CAC Agent:
Create a Task
- Open the Task Scheduler application.
- Click Create Task...
- On the General tab:
- A name for the task that you will remember. We like Equity Analytics SMS Files.
- Check Run whether user is logged in or not
- Check Run with highest privileges
- On the Triggers tab:
- Click New...
- Set the task to occur daily at a time (ie. 10:30pm). Note that the time of this task should be after the CAC Agent is run.
- Ensure the status is Enabled.
- On the Actions tab:
- Click New...
- Set the Action to Start a program.
- For Program/script, set
cmd.exe
. - In the Add arguments box, paste the code snippet below, replacing DIRECTORY, SIS_ID, and TOKEN with the appropriate values.
- On the Conditions tab:
- Check Start the task only if the computer is on AC power.
- Check Stop if the computer switches to battery power.
- On the Settings tab:
- Check Allow task to be run on demand.
- Check Stop the task if it runs longer than: and set it to 3 days.
- Check If the running task does not end when requested, force it to stop.
- The History tab does not need to be configured, but you can use it at a later date to determine if the task is running properly.
- Click to create the task.
- With the newly created task selected, click Run to check that the task is working properly.
Code Snippet
Use this code in the Actions tab, replacing DIRECTORY, SIS_ID, and TOKEN with the appropriate values.
for %f in (C:\DIRECTORY\*.csv) do curl -s -X POST http://equityanalyticsms.com/api/v1/accounts/SIS_ID/files ^
-H "Accept: application/json" ^
-H "Authorization: Bearer TOKEN" ^
-F "file=@%f"