-
Notifications
You must be signed in to change notification settings - Fork 14
Canvas API Endpoints Used by the Hypothesis LMS App
The Hypothesis LMS app includes an optional feature for Canvas which allows users to select PDFs from their Canvas course file repository. Enabling this feature requires creating a Canvas developer key before proceeding with app installation.
If a Canvas developer key is not provided during the app install process, users will still be able to create Hypothesis-enabled readings with public URLs and PDFs from their Google Drive accounts.
Canvas admins should know that the Canvas File Picker accesses the following Canvas API endpoints:
- The List Files API (to show the teacher the list of Canvas files to choose from)
- The Inline Preview URL API (to get a "public" URL for the file so we can show the file to the user and let them annotate it)
Canvas allows admins to create scoped developer keys, so that external apps and tools are not granted access to any data that is not required for the app/tool to function. Previously, our LMS app did not specify scopes when requesting an OAuth token, which meant scoped dev keys did not work. This was fixed in https://github.com/hypothesis/lms/issues/806.
The use of scoped dev keys is not encouraged, as we might need to adjust the permissions/scopes needed by our app in the future as we continue to expand the functionality of our app. For those that institutions require the use of scoped dev keys, as of July 2019, here are the permissions currently required:
- url:GET|api/v1/courses/:course_id:/files
- url:GET|api/v1/files/:id/public_url
These are shown in the screenshots below:
If a user has installed the app with a scoped Canvas Developer Key and the Canvas File Picker does not show up, ensure that:
- The user has checked the correct permissions
- The developer key is turned on