How do I automate data exports?
Learn the best practices for automating data exports from databases or other data sources.
Automating data exports requires the utilization of the REST API. The REST API is a tool that will allow you to communicate with Istation's servers to extract your student's ISIP scores from the database.
If you don't need to automate this process, skip to this article's Endpoint and Parameters sections. Copying the endpoint URL with the desired parameters directly into your browser will download the data into a CSV file.
Step-by-Step Guide for Automating Data Exports
Authentication
Authentication is required before making any API requests. To authenticate, you will need to do a secure POST to https://secure.istation.com/Account/LogOn with the following case-sensitive parameters:
- domain
- username
- password
The login page will return a session cookie called .ASPXAUTH that you must include in subsequent requests. Authenticating and capturing this cookie with cURL looks like this:
-c saves the cookie to a text file, which you will need to reference later to authenticate when making the endpoint requests.
-d sends the specified data, in this case, the login credentials, in an POST request to the HTTP server the same way a browser does when a user has filled in an HTML form and presses the submit button.
This content will be shown (depending on) when the submit button is clicked.
Endpoint
https://secure.istation.com/Report/AssessmentResultExport?Year=YYYY
This endpoint will generate a CSV resource with student ISIP scores. The year you specify will return results for the school year that begins with that year. For example, 2021 will return results for the 2021-2022 school year.
Parameters
You can add parameters to the endpoint URL above to target specific data. See the parameter details below:
Example endpoint using all parameters:
Requests
Once you have built your report URL using the desired endpoint and parameters, you must request an HTTP targeting the URL and referencing the cookie you previously saved.
In cURL, it will look something like this:
-b reads the previously saved cookie for authentication.
Place the desired endpoint URL in the first pair of quotes, and insert the path to the location where you wish to save the file in the second pair of quotes.
Full Script Example
With cURL, you will need to combine the authentication and requests into a single script. Doing so will allow you to automate a scheduled export of the desired data.
All requests to Istation servers use HTTPS, which is secure and will be encrypted through the network when you send the request, but saving usernames and passwords in plain text in a script could still be a local security concern. Because of this, we recommend only storing and executing the script on a secured device. You can also use the @echo off command in the first line of your script to hide the username and password from being displayed in the terminal when the script is executed.
Here is what a full script might look like using cURL:
Alternative Endpoint
https://secure.istation.com/Export/AssessmentResult?Year=YYYY
This is a different endpoint you can use, but it behaves differently. We do not recommend using this unless one of the following conditions applies:
- You need an export for the entire school year for the math product. This is not possible with the primary endpoint.
- You need an export with the overall and all subtest scores for the entire school year.
Other considerations:
- The alternative endpoint defaults Pivot to False instead of True.
Setting Pivot to True without a specified period will only return each student's latest assessment result for the entire school year.
Data Output
The data you target will be exported in a CSV file.
Please note: The scope of students included in the export is determined by the login credentials used. For example, if credentials for a district-level admin account are used for authentication, all students in the district will be included in the export. If credentials for a campus-level admin account are used, then only students at their campus will be included in the export.
If you have any questions about this information, please contact our support team at: support@istation.com or 866-883-7323, option 2.