The Canvas API allows you to tap into the power of the Canvas Learning Management System, enabling educators and administrators to automate tasks, synchronize educational tools, and manage courses and users programmatically. It provides endpoints for accessing course information, user details, assignments, and more, which can be incredibly useful for creating customized educational experiences and streamlining administrative workflows. With Pipedream, you can harness these capabilities to trigger actions, connect with other apps and services, and create complex automations without writing extensive code.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
canvas: {
type: "app",
app: "canvas",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.canvas.$auth.domain}/api/v1/users/self`,
headers: {
Authorization: `Bearer ${this.canvas.$auth.oauth_access_token}`,
},
})
},
})
Automated Course Enrollment: Trigger an automation that adds students to courses in Canvas based on their enrollment in a separate student information system. When a new student record is created in the SIS, the workflow on Pipedream can add that student to the appropriate Canvas course.
Assignment Submission Tracking: Monitor assignment submissions in real-time by setting up a workflow that listens for new submissions on Canvas. When a submission is detected, send a notification to the instructor via email, Slack, or another messaging service connected through Pipedream.
Grading and Feedback Sync: Simplify the grading process by creating a workflow that automatically retrieves new grades entered in Canvas and syncs them with an external gradebook. Additionally, feedback entered in the external system can be pushed back to Canvas, keeping all records consistent and up-to-date.
Canvas uses OAuth authentication. When you connect your Canvas account, Pipedream will open a popup window where you can sign into Canvas and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Canvas API.
Pipedream requests the following authorization scopes when you connect your account:
GET
https://{{custom_fields.domain}}/login/oauth2/auth
?
client_id={{custom_fields.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://{{custom_fields.domain}}/login/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
replace_tokens=false
POST
https://{{custom_fields.domain}}/login/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}