Monday, April 6, 2015

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.


No comments:

Post a Comment