Canvas Automation - How do I download, import, modify and copy the UWM Canvas Postman environment?
This article describes how to set-up a Postman environment based on a UWM template to aid in automating tasks in Canvas.
What is an environment?
An environment is a set of variables for Postman. API calls and and collections leverage environment variables to flexibly perform actions. Most Canvas administrators will have one environment that contains the necessary information to connect to the instructional Canvas instance (where PAWS-provisioned courses live). It may be necessary to set-up multiple environments if your role requires connecting to multiple Canvas instances.
For an advanced description and perspective on environments, see Postman Learning Center - Intro to environments and globals.
About the UWM Environment Template
A template .JSON file has been provided by the Center for Excellence in Teaching and Learning to help set-up Postman for use with the UW System Canvas service.
Download the environment template
Contact CETL for a link to the environment template to be downloaded.
Import the environment template
Once a .JSON file is downloaded and unzipped, it can be imported into Postman.
- Open the Postman application.
- At the top of the Postman window, click the Import button.
- A new window will appear. Click the "Choose Files" button and select the .JSON file suggested. Alternatively, drag-and-drop the .JSON file into the provided landing labeled "Drop files here".
To verify that the template imported correctly, click gear icon in the upper right corner of the Postman window. The Manage Environments window will open. A profile should be listed named "UWM Canvas Template".
Click the X in the corner window, or press Escape on the keyboard to close the window.
Modify the environment
Before Postman can be used to automate activities in Canvas, the environment template must be updated.
To edit the template environment, click the gear icon in the upper right corner. Then, click "UWM Canvas Template".
Update the profile name
Click the name textbox at the top of the variable list. Edit the profile to an appropriate name. Best practice: use a name in the following format "<service> - <environment> - <instance>"
Example: For UWM's Canvas production SIS service (the one that most UWM business is conducted on), enter "UWM Canvas - Prod - SIS". For UWM's test Continuing Education service, enter "UWM Canvas - Test - Continuing Ed".
Update variables so pre-made collections will work correctly. The initial value column must be updated for the following variables, where the values need to be found or created:
- server - the web-accessible URL of the Canvas server to automate against.
- Default: uwmil.instructure.com
- Change this to match the Canvas server you wish to use. For example, enter uws-ce.instructure.com to use automation against UWM's Continuing Education Canvas site, or uws-td.instructure.com to use automation against UWM's Training and Development Canvas site.
- token - the bearer token used to authorize API calls against Canvas
- Default: NULL
- To create and manage a bearer token, review the following KB article: Canvas Automation - How do I create, destroy and manage a bearer token for use with Postman?
- top_account - the ID number of the top-most sub account in Canvas you have access to as an administrator
- Default: NULL
- To set this value, click the Admin icon in Canvas, then click the sub account you wish to perform automation against. Look at the URL and make note of the number at the end.
- Example: to automate against the Instructional Top Level sub account, look at the URL: https://uwmil.instructure.com/accounts/49?. The number at the end of the URL is 49. Enter 49 in top_account field.
- my_user_id - the ID number corresponding to your account in Canvas
- Default: NULL
- To set this value, click the Admin icon in Canvas, then click any sub account. Click the People link in the left-side navigation. Enter your email address in the search box. Click your name in the list. Look at the URL and make note of the number at the end.
- Example: If your URL is https://uwmil.instructure.com/accounts/50/users/15742, Enter 15742 in the my_user_id variable.
Once variables are set, Click the Reset All link at the top of the variables list.
Click the Update button to save the environment.
Copy an edited environment
- In Postman, click the gear icon in the upper right corner of the Postman window.
- Click the "Duplicate Environment" double-paper icon to the right of the Share button.