This is a collection of several API scripts using the Transparent Classroom API.
The scripts are meant to serve as examples of what is possible.
The documentation for the API is at http://transparentclassroom.com/api
Follow these instructions to run a script using ruby.
-
Follow the instructions on http://transparentclassroom.com/api to get your API token. Then set it as an environment variable.
export TC_API_TOKEN=my_api_token
-
Optionally, set a masquerade_id:
export TC_MASQUERADE_ID=masquerade_id
-
Install gems
bundle install
-
Script specific setup
-
pull_retention_rates.rb
- Define optional
config.yml
(refer toconfig.template.yml
)
- Define optional
-
pull_all_children.rb
-
Set the
SCHOOL_YEAR
env var for the year of data you would like to pull, use the formatYYYY-YY
:export SCHOOL_YEAR=2018-19
-
-
-
Run a script
ruby ./pull_retention_rates.rb
Point script to a different TC API endpoint by using the TC_API_BASE_URL
env var (default: https://www.transparentclassroom.com/api/v1
):
export ENV['TC_API_BASE_URL']=http://localhost/api/v1