Monday, April 6, 2015

Canvas List All Available Reports via API

Using Postman (see earlier in this blog)

GET
https://uth.instructure.com/api/v1/accounts/1/reports
HEADER:
Name: Authorization
Value: Bearer 1350~MF9c2npiG...(token)

This will give you all available reports, including (for those that have been run) url's where each can be downloaded.
See: https://canvas.instructure.com/doc/api/account_reports.html

Send token as header via ssl, not as a URL parameter. The latter works, but is much less secure.

Canvas API First attempt

Access the canvas API using Postman

This command will create a new user in Canvas using the API

1. Install Postman app in Chrome (https://chrome.google.com/webstore/category/apps, find Postman REST Client)

2. Generate access token in Canvas (Settings, Approved Integrations, New Access Token). Save the text-generated access token
3. In Postman, create the following POST request:

Some notes on this:
  • The URL has two parts: the API call ("https://uth.test.instructure.com/api/v1/accounts/self/users") and the access token, authorizing the API call ("?access_token=1350~pGr2UxliAgQocy...")
  • The URL API call format is documented at https://canvas.instructure.com/doc/api/users.html, in the section "Create a user"
  • The value after "accounts" can be either "self" (as above) or the numeric value of any account; it doesn't seem to matter. But it MUST be the value of an existing account; a random number here will not work.


20150406 Canvas Active Courses Count

run the following reports:
Provisioning (users, courses, sections, enrollments)
Unpublished Courses (All terms)
Unused Courses (All terms)