├── Get-Context-ID ├── LTI-Context-ID-Scrapper-Tool.ps1 └── courses.csv ├── InstructureCon2021 ├── Canvas-Power-Automate-Custom-Connector-Swagger.json └── README.md └── README.md /Get-Context-ID/LTI-Context-ID-Scrapper-Tool.ps1: -------------------------------------------------------------------------------- 1 | # Script to locate the context ID of Canvas Courses and produce a file to import into Zoom LTI Pro 2 | # Version 1.0 3 | # Working as of 2/28/2021 4 | # Created by Justin Carrell 5 | # Error handling style provided by https://github.com/kajigga 6 | # This is an unsupported, community-created project. Keep that in mind. 7 | # Instructure won't be able to help you fix or debug this. 8 | # All software, code, and information contained herein is provided as-is with no warranty. 9 | 10 | # Configuration Variables 11 | $canvasURL = 'canvas.instructure.com' # Canvas Instance URL do not include https:// (Example: canvas.instructure.com) 12 | $token = '' # An API token for a user with adequate permission to navigate to all courses 13 | $inputFile = 'C:\canvas\zoom\courses.csv' # Full Path to file to process. The file should contain a header with 'canvas_course_id' and 'meeting_id' 14 | $exportZoomFile = "C:\canvas\zoom\zoom.csv" # Location to Export the Data 15 | $ltiID = '175' # LTI ID Number of Zoom. LAunch zoom from a course. ID will be in the URL. 16 | $launch_type = 'course_navigation' # When doing a sessionless launch, we want it to act like a course navigation launch 17 | $zoomExportHeader = "Meeting ID,Context ID,Domain,custom_canvas_course_id" # Header file of the Zoom file 18 | 19 | #************ Do Not Edit Below This Line ************ 20 | 21 | #Check for file 22 | if(!(Test-Path $inputFile)){ 23 | Write-Host Input file does not exist! 24 | exit 25 | } 26 | 27 | #Check for Zoom export file. Remove if it already exists. 28 | if((Test-Path $exportZoomFile)){ 29 | Remove-Item $exportZoomFile 30 | } 31 | 32 | Add-Content $exportZoomFile -Value $zoomExportHeader 33 | 34 | $headers = @{"Authorization"="Bearer "+$token} 35 | $in_data = Import-CSV($inputFile); 36 | 37 | forEach($item in $in_data){ 38 | $course_id = $item.canvas_course_id 39 | $meeting_id = $item.meeting_id 40 | $url = 'https://'+$canvasURL+'/api/v1/courses/'+$course_id+'/external_tools/sessionless_launch?id='+$ltiID+'&launch_type='+$launch_type+'' 41 | Write-Host Generating Session Launch URL for $course_id 42 | Try { 43 | $results = (Invoke-WebRequest -Headers $headers -Method GET -Uri $url) 44 | Try{ 45 | $jresults = ($results.Content | ConvertFrom-Json) 46 | if($jresults.id){ 47 | $HTML = Invoke-WebRequest $jresults.url 48 | $HTML -match '' |out-null 49 | $context_id = $Matches.Values -replace '.*value="' -replace '" />' 50 | Write-Host " Context ID:" $context_id 51 | 52 | $file_contents = ''+$meeting_id+','+$context_id+',https://'+$canvasURL+','+$course_id+'' 53 | Add-Content $exportZoomFile -Value $file_contents 54 | 55 | Write-Host " Context ID Added to Excel File" 56 | Write-Host " " 57 | } 58 | }Catch{ 59 | Write-Host " Unable to complete request. An error occured: " + $_.Exception 60 | } 61 | } Catch { 62 | $errorMsg = $_.Exception 63 | $terminate = $false 64 | if($errorMsg.Response.StatusCode -eq 'unauthorized'){ 65 | $msg = "The provided token is not from a user with sufficient permission to complete the action." 66 | $terminate = $true 67 | }elseif($errorMsg.Response.StatusCode.Value__ -eq "400"){ 68 | $msg = "Unable to start copy." 69 | $terminate = $false 70 | }else{ 71 | $msg = "An error occured: " + $errorMsg 72 | $terminate = $true 73 | } 74 | Write-Host " ERROR:" $msg 75 | if($terminate){ break } 76 | } 77 | } 78 | Write-Host " " 79 | Write-Host "Script Complete" 80 | -------------------------------------------------------------------------------- /Get-Context-ID/courses.csv: -------------------------------------------------------------------------------- 1 | canvas_course_id,meeting_id 2 | 12345,1234567891 3 | 54321,2345678911 4 | -------------------------------------------------------------------------------- /InstructureCon2021/Canvas-Power-Automate-Custom-Connector-Swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Canvas", 5 | "description": "Canvas API Endpoints", 6 | "version": "1.0" 7 | }, 8 | "host": "canvas.instructure.com", 9 | "basePath": "/", 10 | "schemes": [ 11 | "https" 12 | ], 13 | "consumes": [], 14 | "produces": [], 15 | "paths": { 16 | "/api/v1/courses/{course_id}/pages": { 17 | "post": { 18 | "responses": { 19 | "200": { 20 | "description": "default", 21 | "schema": { 22 | "type": "object", 23 | "properties": { 24 | "title": { 25 | "type": "string", 26 | "description": "title" 27 | }, 28 | "created_at": { 29 | "type": "string", 30 | "description": "created_at" 31 | }, 32 | "url": { 33 | "type": "string", 34 | "description": "url" 35 | }, 36 | "editing_roles": { 37 | "type": "string", 38 | "description": "editing_roles" 39 | }, 40 | "page_id": { 41 | "type": "integer", 42 | "format": "int32", 43 | "description": "page_id" 44 | }, 45 | "last_edited_by": { 46 | "type": "object", 47 | "properties": { 48 | "id": { 49 | "type": "integer", 50 | "format": "int32", 51 | "description": "id" 52 | }, 53 | "display_name": { 54 | "type": "string", 55 | "description": "display_name" 56 | }, 57 | "avatar_image_url": { 58 | "type": "string", 59 | "description": "avatar_image_url" 60 | }, 61 | "html_url": { 62 | "type": "string", 63 | "description": "html_url" 64 | }, 65 | "pronouns": { 66 | "type": "string", 67 | "description": "pronouns" 68 | } 69 | }, 70 | "description": "last_edited_by" 71 | }, 72 | "published": { 73 | "type": "boolean", 74 | "description": "published" 75 | }, 76 | "hide_from_students": { 77 | "type": "boolean", 78 | "description": "hide_from_students" 79 | }, 80 | "front_page": { 81 | "type": "boolean", 82 | "description": "front_page" 83 | }, 84 | "html_url": { 85 | "type": "string", 86 | "description": "html_url" 87 | }, 88 | "todo_date": { 89 | "type": "string", 90 | "description": "todo_date" 91 | }, 92 | "updated_at": { 93 | "type": "string", 94 | "description": "updated_at" 95 | }, 96 | "locked_for_user": { 97 | "type": "boolean", 98 | "description": "locked_for_user" 99 | }, 100 | "body": { 101 | "type": "string", 102 | "description": "body" 103 | } 104 | } 105 | } 106 | } 107 | }, 108 | "summary": "Create Canvas Page", 109 | "description": "Create a Canvas Page in a Course", 110 | "operationId": "PAGE-CREATE", 111 | "parameters": [ 112 | { 113 | "name": "course_id", 114 | "in": "path", 115 | "required": true, 116 | "type": "string" 117 | }, 118 | { 119 | "name": "wiki_page[title]", 120 | "in": "query", 121 | "required": false, 122 | "type": "string" 123 | }, 124 | { 125 | "name": "wiki_page[editing_roles]", 126 | "in": "query", 127 | "required": false, 128 | "type": "string" 129 | }, 130 | { 131 | "name": "wiki_page[notify_of_update]", 132 | "in": "query", 133 | "required": false, 134 | "type": "boolean" 135 | }, 136 | { 137 | "name": "wiki_page[published]", 138 | "in": "query", 139 | "required": false, 140 | "type": "boolean" 141 | }, 142 | { 143 | "name": "wiki_page[body]", 144 | "in": "query", 145 | "required": false, 146 | "type": "string" 147 | } 148 | ] 149 | } 150 | }, 151 | "/api/v1/courses/{course_id}/modules": { 152 | "post": { 153 | "responses": { 154 | "200": { 155 | "description": "default", 156 | "schema": { 157 | "type": "object", 158 | "properties": { 159 | "id": { 160 | "type": "integer", 161 | "format": "int32", 162 | "description": "id" 163 | }, 164 | "name": { 165 | "type": "string", 166 | "description": "name" 167 | }, 168 | "position": { 169 | "type": "integer", 170 | "format": "int32", 171 | "description": "position" 172 | }, 173 | "unlock_at": { 174 | "type": "string", 175 | "description": "unlock_at" 176 | }, 177 | "require_sequential_progress": { 178 | "type": "boolean", 179 | "description": "require_sequential_progress" 180 | }, 181 | "publish_final_grade": { 182 | "type": "boolean", 183 | "description": "publish_final_grade" 184 | }, 185 | "prerequisite_module_ids": { 186 | "type": "array", 187 | "items": {}, 188 | "description": "prerequisite_module_ids" 189 | }, 190 | "published": { 191 | "type": "boolean", 192 | "description": "published" 193 | }, 194 | "items_count": { 195 | "type": "integer", 196 | "format": "int32", 197 | "description": "items_count" 198 | }, 199 | "items_url": { 200 | "type": "string", 201 | "description": "items_url" 202 | } 203 | } 204 | } 205 | } 206 | }, 207 | "summary": "Create a Canvas Module", 208 | "operationId": "MODULE-CREATE", 209 | "description": "This will create a Canvas Module in a Course", 210 | "parameters": [ 211 | { 212 | "name": "course_id", 213 | "in": "path", 214 | "required": true, 215 | "type": "string" 216 | }, 217 | { 218 | "name": "module[name]", 219 | "in": "query", 220 | "required": false, 221 | "type": "string" 222 | }, 223 | { 224 | "name": "module[position]", 225 | "in": "query", 226 | "required": false, 227 | "type": "integer" 228 | }, 229 | { 230 | "name": "module[require_sequential_progress]", 231 | "in": "query", 232 | "required": false, 233 | "type": "boolean" 234 | }, 235 | { 236 | "name": "wiki_page[published]", 237 | "in": "query", 238 | "required": false, 239 | "type": "boolean" 240 | } 241 | ] 242 | } 243 | }, 244 | "/api/v1/courses/{course_id}/modules/{module_id}/items": { 245 | "post": { 246 | "responses": { 247 | "200": { 248 | "description": "default", 249 | "schema": { 250 | "type": "object", 251 | "properties": { 252 | "id": { 253 | "type": "integer", 254 | "format": "int32", 255 | "description": "id" 256 | }, 257 | "title": { 258 | "type": "string", 259 | "description": "title" 260 | }, 261 | "position": { 262 | "type": "integer", 263 | "format": "int32", 264 | "description": "position" 265 | }, 266 | "indent": { 267 | "type": "integer", 268 | "format": "int32", 269 | "description": "indent" 270 | }, 271 | "type": { 272 | "type": "string", 273 | "description": "type" 274 | }, 275 | "module_id": { 276 | "type": "integer", 277 | "format": "int32", 278 | "description": "module_id" 279 | }, 280 | "html_url": { 281 | "type": "string", 282 | "description": "html_url" 283 | }, 284 | "page_url": { 285 | "type": "string", 286 | "description": "page_url" 287 | }, 288 | "url": { 289 | "type": "string", 290 | "description": "url" 291 | }, 292 | "published": { 293 | "type": "boolean", 294 | "description": "published" 295 | } 296 | } 297 | } 298 | } 299 | }, 300 | "summary": "Add an item to a course module", 301 | "description": "This will add an item to a course module", 302 | "operationId": "MODULE-ADD-ITEM", 303 | "parameters": [ 304 | { 305 | "name": "course_id", 306 | "in": "path", 307 | "required": true, 308 | "type": "string" 309 | }, 310 | { 311 | "name": "module_id", 312 | "in": "path", 313 | "required": true, 314 | "type": "string" 315 | }, 316 | { 317 | "name": "module_item[title]", 318 | "in": "query", 319 | "required": false, 320 | "type": "string" 321 | }, 322 | { 323 | "name": "module_item[type]", 324 | "in": "query", 325 | "required": false, 326 | "type": "string" 327 | }, 328 | { 329 | "name": "module_item[position]", 330 | "in": "query", 331 | "required": false, 332 | "type": "integer" 333 | }, 334 | { 335 | "name": "wiki_page[published]", 336 | "in": "query", 337 | "required": false, 338 | "type": "boolean" 339 | }, 340 | { 341 | "name": "module_item[page_url]", 342 | "in": "query", 343 | "required": false, 344 | "type": "string" 345 | } 346 | ] 347 | } 348 | }, 349 | "/api/v1/courses/{course_id}/modules/{module_id}": { 350 | "put": { 351 | "responses": { 352 | "default": { 353 | "description": "default", 354 | "schema": { 355 | "type": "object", 356 | "properties": { 357 | "id": { 358 | "type": "integer", 359 | "format": "int32", 360 | "description": "id" 361 | }, 362 | "name": { 363 | "type": "string", 364 | "description": "name" 365 | }, 366 | "position": { 367 | "type": "integer", 368 | "format": "int32", 369 | "description": "position" 370 | }, 371 | "unlock_at": { 372 | "type": "string", 373 | "description": "unlock_at" 374 | }, 375 | "require_sequential_progress": { 376 | "type": "boolean", 377 | "description": "require_sequential_progress" 378 | }, 379 | "publish_final_grade": { 380 | "type": "boolean", 381 | "description": "publish_final_grade" 382 | }, 383 | "prerequisite_module_ids": { 384 | "type": "array", 385 | "items": {}, 386 | "description": "prerequisite_module_ids" 387 | }, 388 | "published": { 389 | "type": "boolean", 390 | "description": "published" 391 | }, 392 | "items_count": { 393 | "type": "integer", 394 | "format": "int32", 395 | "description": "items_count" 396 | }, 397 | "items_url": { 398 | "type": "string", 399 | "description": "items_url" 400 | }, 401 | "publish_warning": { 402 | "type": "boolean", 403 | "description": "publish_warning" 404 | } 405 | } 406 | } 407 | } 408 | }, 409 | "summary": "Update Canvas Module", 410 | "description": "Use this to update a Canvas Module", 411 | "operationId": "MODULE-UPDATE", 412 | "parameters": [ 413 | { 414 | "name": "course_id", 415 | "in": "path", 416 | "required": true, 417 | "type": "string" 418 | }, 419 | { 420 | "name": "module_id", 421 | "in": "path", 422 | "required": true, 423 | "type": "string" 424 | }, 425 | { 426 | "name": "module[name]", 427 | "in": "query", 428 | "required": false, 429 | "type": "string" 430 | }, 431 | { 432 | "name": "module[position]", 433 | "in": "query", 434 | "required": false, 435 | "type": "integer" 436 | }, 437 | { 438 | "name": "module[published]", 439 | "in": "query", 440 | "required": false, 441 | "type": "boolean" 442 | } 443 | ] 444 | } 445 | }, 446 | "/api/v1/courses/{course_id}/tabs/{tab_id}": { 447 | "put": { 448 | "responses": { 449 | "200": { 450 | "description": "default", 451 | "schema": { 452 | "type": "object", 453 | "properties": { 454 | "id": { 455 | "type": "string", 456 | "description": "id" 457 | }, 458 | "html_url": { 459 | "type": "string", 460 | "description": "html_url" 461 | }, 462 | "full_url": { 463 | "type": "string", 464 | "description": "full_url" 465 | }, 466 | "position": { 467 | "type": "integer", 468 | "format": "int32", 469 | "description": "position" 470 | }, 471 | "visibility": { 472 | "type": "string", 473 | "description": "visibility" 474 | }, 475 | "label": { 476 | "type": "string", 477 | "description": "label" 478 | }, 479 | "type": { 480 | "type": "string", 481 | "description": "type" 482 | }, 483 | "url": { 484 | "type": "string", 485 | "description": "url" 486 | } 487 | } 488 | } 489 | } 490 | }, 491 | "summary": "Course Menu Tools", 492 | "description": "Set the order of Course Menu Tools", 493 | "operationId": "COURSE-MENU", 494 | "parameters": [ 495 | { 496 | "name": "course_id", 497 | "in": "path", 498 | "required": true, 499 | "type": "string" 500 | }, 501 | { 502 | "name": "tab_id", 503 | "in": "path", 504 | "required": true, 505 | "type": "string" 506 | }, 507 | { 508 | "name": "position", 509 | "in": "query", 510 | "required": false, 511 | "type": "integer" 512 | }, 513 | { 514 | "name": "hidden", 515 | "in": "query", 516 | "required": false, 517 | "type": "boolean" 518 | } 519 | ] 520 | } 521 | }, 522 | "/api/v1/accounts/{account_id}/courses": { 523 | "post": { 524 | "responses": { 525 | "200": { 526 | "description": "default", 527 | "schema": { 528 | "type": "object", 529 | "properties": { 530 | "id": { 531 | "type": "integer", 532 | "format": "int32", 533 | "description": "id" 534 | }, 535 | "name": { 536 | "type": "string", 537 | "description": "name" 538 | }, 539 | "account_id": { 540 | "type": "integer", 541 | "format": "int32", 542 | "description": "account_id" 543 | }, 544 | "uuid": { 545 | "type": "string", 546 | "description": "uuid" 547 | }, 548 | "start_at": { 549 | "type": "string", 550 | "description": "start_at" 551 | }, 552 | "conclude_at": { 553 | "type": "string", 554 | "description": "conclude_at" 555 | }, 556 | "grading_standard_id": { 557 | "type": "string", 558 | "description": "grading_standard_id" 559 | }, 560 | "is_public": { 561 | "type": "string", 562 | "description": "is_public" 563 | }, 564 | "created_at": { 565 | "type": "string", 566 | "description": "created_at" 567 | }, 568 | "allow_student_forum_attachments": { 569 | "type": "boolean", 570 | "description": "allow_student_forum_attachments" 571 | }, 572 | "course_code": { 573 | "type": "string", 574 | "description": "course_code" 575 | }, 576 | "default_view": { 577 | "type": "string", 578 | "description": "default_view" 579 | }, 580 | "root_account_id": { 581 | "type": "integer", 582 | "format": "int32", 583 | "description": "root_account_id" 584 | }, 585 | "enrollment_term_id": { 586 | "type": "integer", 587 | "format": "int32", 588 | "description": "enrollment_term_id" 589 | }, 590 | "open_enrollment": { 591 | "type": "boolean", 592 | "description": "open_enrollment" 593 | }, 594 | "allow_wiki_comments": { 595 | "type": "string", 596 | "description": "allow_wiki_comments" 597 | }, 598 | "self_enrollment": { 599 | "type": "boolean", 600 | "description": "self_enrollment" 601 | }, 602 | "license": { 603 | "type": "string", 604 | "description": "license" 605 | }, 606 | "restrict_enrollments_to_course_dates": { 607 | "type": "boolean", 608 | "description": "restrict_enrollments_to_course_dates" 609 | }, 610 | "grade_passback_setting": { 611 | "type": "string", 612 | "description": "grade_passback_setting" 613 | }, 614 | "end_at": { 615 | "type": "string", 616 | "description": "end_at" 617 | }, 618 | "public_syllabus": { 619 | "type": "boolean", 620 | "description": "public_syllabus" 621 | }, 622 | "public_syllabus_to_auth": { 623 | "type": "boolean", 624 | "description": "public_syllabus_to_auth" 625 | }, 626 | "storage_quota_mb": { 627 | "type": "integer", 628 | "format": "int32", 629 | "description": "storage_quota_mb" 630 | }, 631 | "is_public_to_auth_users": { 632 | "type": "boolean", 633 | "description": "is_public_to_auth_users" 634 | }, 635 | "hide_final_grades": { 636 | "type": "boolean", 637 | "description": "hide_final_grades" 638 | }, 639 | "apply_assignment_group_weights": { 640 | "type": "boolean", 641 | "description": "apply_assignment_group_weights" 642 | }, 643 | "calendar": { 644 | "type": "object", 645 | "properties": { 646 | "ics": { 647 | "type": "string", 648 | "description": "ics" 649 | } 650 | }, 651 | "description": "calendar" 652 | }, 653 | "time_zone": { 654 | "type": "string", 655 | "description": "time_zone" 656 | }, 657 | "blueprint": { 658 | "type": "boolean", 659 | "description": "blueprint" 660 | }, 661 | "sis_course_id": { 662 | "type": "string", 663 | "description": "sis_course_id" 664 | }, 665 | "sis_import_id": { 666 | "type": "string", 667 | "description": "sis_import_id" 668 | }, 669 | "integration_id": { 670 | "type": "string", 671 | "description": "integration_id" 672 | }, 673 | "workflow_state": { 674 | "type": "string", 675 | "description": "workflow_state" 676 | } 677 | } 678 | } 679 | } 680 | }, 681 | "summary": "Create Course", 682 | "description": "Create a Canvas Course", 683 | "operationId": "COURSE-CREATE", 684 | "parameters": [ 685 | { 686 | "name": "account_id", 687 | "in": "path", 688 | "required": true, 689 | "type": "string" 690 | }, 691 | { 692 | "name": "as_user_id", 693 | "in": "query", 694 | "required": false, 695 | "type": "string" 696 | }, 697 | { 698 | "name": "course[name]", 699 | "in": "query", 700 | "required": false, 701 | "type": "string" 702 | }, 703 | { 704 | "name": "course[course_code]", 705 | "in": "query", 706 | "required": false, 707 | "type": "string" 708 | }, 709 | { 710 | "name": "course[open_enrollment]", 711 | "in": "query", 712 | "required": false, 713 | "type": "boolean" 714 | }, 715 | { 716 | "name": "course[self_enrollment]", 717 | "in": "query", 718 | "required": false, 719 | "type": "boolean" 720 | }, 721 | { 722 | "name": "course[term_id]", 723 | "in": "query", 724 | "required": false, 725 | "type": "integer" 726 | }, 727 | { 728 | "name": "course[sis_course_id]", 729 | "in": "query", 730 | "required": false, 731 | "type": "string" 732 | }, 733 | { 734 | "name": "course[integration_id]", 735 | "in": "query", 736 | "required": false, 737 | "type": "string" 738 | }, 739 | { 740 | "name": "enroll_me", 741 | "in": "query", 742 | "required": false, 743 | "type": "boolean" 744 | } 745 | ] 746 | } 747 | }, 748 | "/api/v1/courses/{course_id}/sections": { 749 | "post": { 750 | "responses": { 751 | "200": { 752 | "description": "default", 753 | "schema": { 754 | "type": "object", 755 | "properties": { 756 | "id": { 757 | "type": "integer", 758 | "format": "int32", 759 | "description": "id" 760 | }, 761 | "course_id": { 762 | "type": "integer", 763 | "format": "int32", 764 | "description": "course_id" 765 | }, 766 | "name": { 767 | "type": "string", 768 | "description": "name" 769 | }, 770 | "start_at": { 771 | "type": "string", 772 | "description": "start_at" 773 | }, 774 | "end_at": { 775 | "type": "string", 776 | "description": "end_at" 777 | }, 778 | "created_at": { 779 | "type": "string", 780 | "description": "created_at" 781 | }, 782 | "restrict_enrollments_to_section_dates": { 783 | "type": "boolean", 784 | "description": "restrict_enrollments_to_section_dates" 785 | }, 786 | "nonxlist_course_id": { 787 | "type": "string", 788 | "description": "nonxlist_course_id" 789 | }, 790 | "sis_section_id": { 791 | "type": "string", 792 | "description": "sis_section_id" 793 | }, 794 | "sis_course_id": { 795 | "type": "string", 796 | "description": "sis_course_id" 797 | }, 798 | "integration_id": { 799 | "type": "string", 800 | "description": "integration_id" 801 | }, 802 | "sis_import_id": { 803 | "type": "string", 804 | "description": "sis_import_id" 805 | } 806 | } 807 | } 808 | } 809 | }, 810 | "summary": "Create Section", 811 | "description": "Create a Section within a Course", 812 | "operationId": "SECTION-CREATE", 813 | "parameters": [ 814 | { 815 | "name": "course_id", 816 | "in": "path", 817 | "required": true, 818 | "type": "string" 819 | }, 820 | { 821 | "name": "as_user_id", 822 | "in": "query", 823 | "required": false, 824 | "type": "string" 825 | }, 826 | { 827 | "name": "course_section[name]", 828 | "in": "query", 829 | "required": false, 830 | "type": "string" 831 | }, 832 | { 833 | "name": "course_section[sis_section_id]", 834 | "in": "query", 835 | "required": false, 836 | "type": "string" 837 | }, 838 | { 839 | "name": "course_section[integration_id]", 840 | "in": "query", 841 | "required": false, 842 | "type": "string" 843 | }, 844 | { 845 | "name": "course_section[restrict_enrollments_to_section_dates]", 846 | "in": "query", 847 | "required": false, 848 | "type": "boolean" 849 | }, 850 | { 851 | "name": "course_section[start_at]", 852 | "in": "query", 853 | "required": false, 854 | "type": "string", 855 | "format": "date-time", 856 | "x-ms-visibility": "advanced", 857 | "description": "Section start date in ISO8601 format, e.g. 2011-01-01T01:00Z" 858 | }, 859 | { 860 | "name": "course_section[end_at]", 861 | "in": "query", 862 | "required": false, 863 | "type": "string", 864 | "format": "date-time", 865 | "description": "Section end date in ISO8601 format. e.g. 2011-01-01T01:00Z", 866 | "x-ms-visibility": "advanced" 867 | } 868 | ] 869 | } 870 | }, 871 | "/api/v1/accounts/{account_id}/users": { 872 | "post": { 873 | "responses": { 874 | "200": { 875 | "description": "default", 876 | "schema": { 877 | "type": "object", 878 | "properties": { 879 | "id": { 880 | "type": "integer", 881 | "format": "int32", 882 | "description": "id" 883 | }, 884 | "name": { 885 | "type": "string", 886 | "description": "name" 887 | }, 888 | "created_at": { 889 | "type": "string", 890 | "description": "created_at" 891 | }, 892 | "sortable_name": { 893 | "type": "string", 894 | "description": "sortable_name" 895 | }, 896 | "short_name": { 897 | "type": "string", 898 | "description": "short_name" 899 | }, 900 | "sis_user_id": { 901 | "type": "string", 902 | "description": "sis_user_id" 903 | }, 904 | "integration_id": { 905 | "type": "string", 906 | "description": "integration_id" 907 | }, 908 | "sis_import_id": { 909 | "type": "string", 910 | "description": "sis_import_id" 911 | }, 912 | "login_id": { 913 | "type": "string", 914 | "description": "login_id" 915 | }, 916 | "locale": { 917 | "type": "string", 918 | "description": "locale" 919 | } 920 | } 921 | } 922 | } 923 | }, 924 | "summary": "Create User", 925 | "description": "Create a Canvas User", 926 | "operationId": "USER-CREATE", 927 | "parameters": [ 928 | { 929 | "name": "account_id", 930 | "in": "path", 931 | "required": true, 932 | "type": "string" 933 | }, 934 | { 935 | "name": "user[name]", 936 | "in": "query", 937 | "required": false, 938 | "type": "string" 939 | }, 940 | { 941 | "name": "user[skip_registration]", 942 | "in": "query", 943 | "required": false, 944 | "type": "boolean" 945 | }, 946 | { 947 | "name": "pseudonym[unique_id]", 948 | "in": "query", 949 | "required": false, 950 | "type": "string" 951 | }, 952 | { 953 | "name": "pseudonym[password]", 954 | "in": "query", 955 | "required": false, 956 | "type": "string" 957 | }, 958 | { 959 | "name": "pseudonym[sis_user_id]", 960 | "in": "query", 961 | "required": false, 962 | "type": "string" 963 | }, 964 | { 965 | "name": "pseudonym[integration_id]", 966 | "in": "query", 967 | "required": false, 968 | "type": "string" 969 | }, 970 | { 971 | "name": "pseudonym[send_confirmation]", 972 | "in": "query", 973 | "required": false, 974 | "type": "boolean" 975 | }, 976 | { 977 | "name": "pseudonym[force_self_registration]", 978 | "in": "query", 979 | "required": false, 980 | "type": "boolean" 981 | }, 982 | { 983 | "name": "communication_channel[address]", 984 | "in": "query", 985 | "required": false, 986 | "type": "string" 987 | } 988 | ] 989 | } 990 | }, 991 | "/api/v1/sections/{section_id}/enrollments": { 992 | "post": { 993 | "responses": { 994 | "200": { 995 | "description": "default", 996 | "schema": { 997 | "type": "object", 998 | "properties": { 999 | "id": { 1000 | "type": "integer", 1001 | "format": "int32", 1002 | "description": "id" 1003 | }, 1004 | "user_id": { 1005 | "type": "integer", 1006 | "format": "int32", 1007 | "description": "user_id" 1008 | }, 1009 | "course_id": { 1010 | "type": "integer", 1011 | "format": "int32", 1012 | "description": "course_id" 1013 | }, 1014 | "type": { 1015 | "type": "string", 1016 | "description": "type" 1017 | }, 1018 | "created_at": { 1019 | "type": "string", 1020 | "description": "created_at" 1021 | }, 1022 | "updated_at": { 1023 | "type": "string", 1024 | "description": "updated_at" 1025 | }, 1026 | "associated_user_id": { 1027 | "type": "string", 1028 | "description": "associated_user_id" 1029 | }, 1030 | "start_at": { 1031 | "type": "string", 1032 | "description": "start_at" 1033 | }, 1034 | "end_at": { 1035 | "type": "string", 1036 | "description": "end_at" 1037 | }, 1038 | "course_section_id": { 1039 | "type": "integer", 1040 | "format": "int32", 1041 | "description": "course_section_id" 1042 | }, 1043 | "root_account_id": { 1044 | "type": "integer", 1045 | "format": "int32", 1046 | "description": "root_account_id" 1047 | }, 1048 | "limit_privileges_to_course_section": { 1049 | "type": "boolean", 1050 | "description": "limit_privileges_to_course_section" 1051 | }, 1052 | "enrollment_state": { 1053 | "type": "string", 1054 | "description": "enrollment_state" 1055 | }, 1056 | "role": { 1057 | "type": "string", 1058 | "description": "role" 1059 | }, 1060 | "role_id": { 1061 | "type": "integer", 1062 | "format": "int32", 1063 | "description": "role_id" 1064 | }, 1065 | "last_activity_at": { 1066 | "type": "string", 1067 | "description": "last_activity_at" 1068 | }, 1069 | "last_attended_at": { 1070 | "type": "string", 1071 | "description": "last_attended_at" 1072 | }, 1073 | "total_activity_time": { 1074 | "type": "integer", 1075 | "format": "int32", 1076 | "description": "total_activity_time" 1077 | }, 1078 | "sis_import_id": { 1079 | "type": "string", 1080 | "description": "sis_import_id" 1081 | }, 1082 | "sis_account_id": { 1083 | "type": "string", 1084 | "description": "sis_account_id" 1085 | }, 1086 | "sis_course_id": { 1087 | "type": "string", 1088 | "description": "sis_course_id" 1089 | }, 1090 | "course_integration_id": { 1091 | "type": "string", 1092 | "description": "course_integration_id" 1093 | }, 1094 | "sis_section_id": { 1095 | "type": "string", 1096 | "description": "sis_section_id" 1097 | }, 1098 | "section_integration_id": { 1099 | "type": "string", 1100 | "description": "section_integration_id" 1101 | }, 1102 | "sis_user_id": { 1103 | "type": "string", 1104 | "description": "sis_user_id" 1105 | }, 1106 | "html_url": { 1107 | "type": "string", 1108 | "description": "html_url" 1109 | } 1110 | } 1111 | } 1112 | } 1113 | }, 1114 | "summary": "Section Enrollment", 1115 | "description": "Enroll a user into a Canvas Section", 1116 | "operationId": "ENROLLMENT-CREATE", 1117 | "parameters": [ 1118 | { 1119 | "name": "section_id", 1120 | "in": "path", 1121 | "required": true, 1122 | "type": "string" 1123 | }, 1124 | { 1125 | "name": "as_user_id", 1126 | "in": "query", 1127 | "required": false, 1128 | "type": "string" 1129 | }, 1130 | { 1131 | "name": "enrollment[user_id]", 1132 | "in": "query", 1133 | "required": false, 1134 | "type": "string" 1135 | }, 1136 | { 1137 | "name": "enrollment[type]", 1138 | "in": "query", 1139 | "required": false, 1140 | "type": "string", 1141 | "enum": [ 1142 | "StudentEnrollment", 1143 | "TeacherEnrollment", 1144 | "TaEnrollment", 1145 | "ObserverEnrollment", 1146 | "DesignerEnrollment" 1147 | ] 1148 | }, 1149 | { 1150 | "name": "enrollment[enrollment_state]", 1151 | "in": "query", 1152 | "required": false, 1153 | "type": "string", 1154 | "enum": [ 1155 | "active", 1156 | "invited", 1157 | "inactive" 1158 | ] 1159 | }, 1160 | { 1161 | "name": "enrollment[notify]", 1162 | "in": "query", 1163 | "required": false, 1164 | "type": "boolean" 1165 | }, 1166 | { 1167 | "name": "enrollment[self_enrolled]", 1168 | "in": "query", 1169 | "required": false, 1170 | "type": "boolean" 1171 | } 1172 | ] 1173 | } 1174 | }, 1175 | "/api/v1/sections/{id}": { 1176 | "get": { 1177 | "responses": { 1178 | "200": { 1179 | "description": "default", 1180 | "schema": { 1181 | "type": "object", 1182 | "properties": { 1183 | "id": { 1184 | "type": "integer", 1185 | "format": "int32", 1186 | "description": "Section ID", 1187 | "title": "" 1188 | }, 1189 | "course_id": { 1190 | "type": "integer", 1191 | "format": "int32", 1192 | "description": "Internal Canvas Course ID", 1193 | "title": "" 1194 | }, 1195 | "name": { 1196 | "type": "string", 1197 | "description": "name" 1198 | }, 1199 | "start_at": { 1200 | "type": "string", 1201 | "description": "start_at" 1202 | }, 1203 | "end_at": { 1204 | "type": "string", 1205 | "description": "end_at" 1206 | }, 1207 | "created_at": { 1208 | "type": "string", 1209 | "description": "created_at" 1210 | }, 1211 | "restrict_enrollments_to_section_dates": { 1212 | "type": "boolean", 1213 | "description": "restrict_enrollments_to_section_dates" 1214 | }, 1215 | "nonxlist_course_id": { 1216 | "type": "string", 1217 | "description": "nonxlist_course_id" 1218 | }, 1219 | "sis_section_id": { 1220 | "type": "string", 1221 | "description": "sis_section_id" 1222 | }, 1223 | "sis_course_id": { 1224 | "type": "string", 1225 | "description": "sis_course_id" 1226 | }, 1227 | "integration_id": { 1228 | "type": "string", 1229 | "description": "integration_id" 1230 | }, 1231 | "sis_import_id": { 1232 | "type": "integer", 1233 | "format": "int32", 1234 | "description": "sis_import_id" 1235 | } 1236 | } 1237 | } 1238 | } 1239 | }, 1240 | "summary": "Section Details", 1241 | "description": "Get section details of a Canvas course", 1242 | "operationId": "SECTION-GET", 1243 | "parameters": [ 1244 | { 1245 | "name": "id", 1246 | "in": "path", 1247 | "required": true, 1248 | "type": "string" 1249 | } 1250 | ] 1251 | } 1252 | }, 1253 | "/api/v1/courses/{course_id}/content_migrations": { 1254 | "post": { 1255 | "responses": { 1256 | "200": { 1257 | "description": "default", 1258 | "schema": { 1259 | "type": "object", 1260 | "properties": { 1261 | "id": { 1262 | "type": "integer", 1263 | "format": "int32", 1264 | "description": "id" 1265 | }, 1266 | "user_id": { 1267 | "type": "integer", 1268 | "format": "int32", 1269 | "description": "user_id" 1270 | }, 1271 | "workflow_state": { 1272 | "type": "string", 1273 | "description": "workflow_state" 1274 | }, 1275 | "started_at": { 1276 | "type": "string", 1277 | "description": "started_at" 1278 | }, 1279 | "finished_at": { 1280 | "type": "string", 1281 | "description": "finished_at" 1282 | }, 1283 | "migration_type": { 1284 | "type": "string", 1285 | "description": "migration_type" 1286 | }, 1287 | "created_at": { 1288 | "type": "string", 1289 | "description": "created_at" 1290 | }, 1291 | "migration_issues_url": { 1292 | "type": "string", 1293 | "description": "migration_issues_url" 1294 | }, 1295 | "migration_issues_count": { 1296 | "type": "integer", 1297 | "format": "int32", 1298 | "description": "migration_issues_count" 1299 | }, 1300 | "progress_url": { 1301 | "type": "string", 1302 | "description": "progress_url" 1303 | }, 1304 | "migration_type_title": { 1305 | "type": "string", 1306 | "description": "migration_type_title" 1307 | } 1308 | } 1309 | } 1310 | } 1311 | }, 1312 | "summary": "Course Copy", 1313 | "description": "Canvas Course Copy", 1314 | "operationId": "COURSE-COPY", 1315 | "parameters": [ 1316 | { 1317 | "name": "course_id", 1318 | "in": "path", 1319 | "required": true, 1320 | "type": "string" 1321 | }, 1322 | { 1323 | "name": "migration_type", 1324 | "in": "query", 1325 | "required": true, 1326 | "type": "string", 1327 | "default": "canvas_cartridge_importer", 1328 | "x-ms-visibility": "important", 1329 | "enum": [ 1330 | "canvas_cartridge_importer", 1331 | "common_cartridge_importer", 1332 | "course_copy_importer", 1333 | "zip_file_importer", 1334 | "qti_converter", 1335 | "moodle_converter" 1336 | ] 1337 | }, 1338 | { 1339 | "name": "settings[file_url]", 1340 | "in": "query", 1341 | "required": true, 1342 | "type": "string", 1343 | "x-ms-visibility": "important" 1344 | }, 1345 | { 1346 | "name": "settings[insert_into_module_id]", 1347 | "in": "query", 1348 | "required": false, 1349 | "type": "string", 1350 | "x-ms-visibility": "advanced" 1351 | }, 1352 | { 1353 | "name": "settings[insert_into_module_position]", 1354 | "in": "query", 1355 | "required": false, 1356 | "type": "string", 1357 | "x-ms-visibility": "advanced" 1358 | }, 1359 | { 1360 | "name": "settings[source_course_id]", 1361 | "in": "query", 1362 | "required": false, 1363 | "type": "integer", 1364 | "format": "int32", 1365 | "description": "The Internal ID of the Canvas Course with Content", 1366 | "x-ms-summary": "Provide the ID of the Canvas Course that has Content", 1367 | "x-ms-visibility": "advanced" 1368 | }, 1369 | { 1370 | "name": "settings[overwrite_quizzes]", 1371 | "in": "query", 1372 | "required": false, 1373 | "type": "boolean", 1374 | "format": "boolean", 1375 | "x-ms-visibility": "advanced", 1376 | "description": "Should the bank be overridden with this one?" 1377 | }, 1378 | { 1379 | "name": "settings[question_bank_name]", 1380 | "in": "query", 1381 | "required": false, 1382 | "type": "integer", 1383 | "format": "int32", 1384 | "x-ms-visibility": "advanced", 1385 | "description": "Name of the Question Bank" 1386 | }, 1387 | { 1388 | "name": "settings[move_to_assignment_group_id]", 1389 | "in": "query", 1390 | "required": false, 1391 | "type": "string", 1392 | "x-ms-visibility": "advanced" 1393 | } 1394 | ] 1395 | } 1396 | }, 1397 | "/api/v1/users/{Canvas User ID}": { 1398 | "get": { 1399 | "responses": { 1400 | "default": { 1401 | "description": "default", 1402 | "schema": { 1403 | "type": "object", 1404 | "properties": { 1405 | "id": { 1406 | "type": "integer", 1407 | "format": "int32", 1408 | "description": "id" 1409 | }, 1410 | "name": { 1411 | "type": "string", 1412 | "description": "name" 1413 | }, 1414 | "sortable_name": { 1415 | "type": "string", 1416 | "description": "sortable_name" 1417 | }, 1418 | "short_name": { 1419 | "type": "string", 1420 | "description": "short_name" 1421 | }, 1422 | "sis_user_id": { 1423 | "type": "string", 1424 | "description": "sis_user_id" 1425 | }, 1426 | "sis_import_id": { 1427 | "type": "integer", 1428 | "format": "int32", 1429 | "description": "sis_import_id" 1430 | }, 1431 | "integration_id": { 1432 | "type": "string", 1433 | "description": "integration_id" 1434 | }, 1435 | "login_id": { 1436 | "type": "string", 1437 | "description": "login_id" 1438 | }, 1439 | "avatar_url": { 1440 | "type": "string", 1441 | "description": "avatar_url" 1442 | }, 1443 | "enrollments": { 1444 | "type": "string", 1445 | "description": "enrollments" 1446 | }, 1447 | "email": { 1448 | "type": "string", 1449 | "description": "email" 1450 | }, 1451 | "locale": { 1452 | "type": "string", 1453 | "description": "locale" 1454 | }, 1455 | "last_login": { 1456 | "type": "string", 1457 | "description": "last_login" 1458 | }, 1459 | "time_zone": { 1460 | "type": "string", 1461 | "description": "time_zone" 1462 | }, 1463 | "bio": { 1464 | "type": "string", 1465 | "description": "bio" 1466 | } 1467 | } 1468 | } 1469 | } 1470 | }, 1471 | "summary": "Get User Information", 1472 | "description": "Get the information of a Canvas User", 1473 | "operationId": "USER-GET", 1474 | "parameters": [ 1475 | { 1476 | "name": "Canvas User ID", 1477 | "in": "path", 1478 | "required": true, 1479 | "type": "string" 1480 | } 1481 | ] 1482 | } 1483 | }, 1484 | "/api/v1/progress/{id}": { 1485 | "get": { 1486 | "responses": { 1487 | "default": { 1488 | "description": "default", 1489 | "schema": { 1490 | "type": "object", 1491 | "properties": { 1492 | "id": { 1493 | "type": "integer", 1494 | "format": "int32", 1495 | "description": "id" 1496 | }, 1497 | "context_id": { 1498 | "type": "integer", 1499 | "format": "int32", 1500 | "description": "context_id" 1501 | }, 1502 | "context_type": { 1503 | "type": "string", 1504 | "description": "context_type" 1505 | }, 1506 | "user_id": { 1507 | "type": "integer", 1508 | "format": "int32", 1509 | "description": "user_id" 1510 | }, 1511 | "tag": { 1512 | "type": "string", 1513 | "description": "tag" 1514 | }, 1515 | "completion": { 1516 | "type": "number", 1517 | "format": "float", 1518 | "description": "completion", 1519 | "title": "" 1520 | }, 1521 | "workflow_state": { 1522 | "type": "string", 1523 | "description": "workflow_state" 1524 | }, 1525 | "created_at": { 1526 | "type": "string", 1527 | "description": "created_at" 1528 | }, 1529 | "updated_at": { 1530 | "type": "string", 1531 | "description": "updated_at" 1532 | }, 1533 | "message": { 1534 | "type": "string", 1535 | "description": "message" 1536 | }, 1537 | "results": { 1538 | "type": "object", 1539 | "properties": { 1540 | "id": { 1541 | "type": "string", 1542 | "description": "id" 1543 | } 1544 | }, 1545 | "description": "results" 1546 | }, 1547 | "url": { 1548 | "type": "string", 1549 | "description": "url" 1550 | } 1551 | } 1552 | } 1553 | } 1554 | }, 1555 | "summary": "Check Progress", 1556 | "description": "Check the progress of a job", 1557 | "operationId": "PROGRESS-CHECK", 1558 | "parameters": [ 1559 | { 1560 | "name": "id", 1561 | "in": "path", 1562 | "required": true, 1563 | "type": "integer" 1564 | } 1565 | ] 1566 | } 1567 | } 1568 | }, 1569 | "definitions": {}, 1570 | "parameters": {}, 1571 | "responses": {}, 1572 | "securityDefinitions": { 1573 | "oauth2_auth": { 1574 | "type": "oauth2", 1575 | "flow": "accessCode", 1576 | "authorizationUrl": "https://canvas.instructure.com/login/oauth2/auth", 1577 | "tokenUrl": "https://canvas.instructure.com/login/oauth2/token", 1578 | "scopes": {} 1579 | } 1580 | }, 1581 | "security": [ 1582 | { 1583 | "oauth2_auth": [] 1584 | } 1585 | ], 1586 | "tags": [] 1587 | } 1588 | -------------------------------------------------------------------------------- /InstructureCon2021/README.md: -------------------------------------------------------------------------------- 1 | # Supercharge your LMS Administration through Automation with the Canvas APIs 2 | 3 | ## Getting Started 4 | 5 | - Import [Canvas-Power-Automate-Custom-Connector-Swagger.json](https://raw.githubusercontent.com/jwadec/Canvas/main/InstructureCon2021/Canvas-Power-Automate-Custom-Connector-Swagger.json) into Microsoft Power Automate as a custom connector using "Import an OpenAPI from a URL" 6 | - Set a Connector name 7 | - Paste the URL for the swagger code 8 | - Select Import 9 | - Select Continue 10 | 11 | ## Special Note 12 | 13 | For best practices, you may want to set up a separate production and test connector. 14 | 15 | ## Setting up developer key in Canvas 16 | 17 | - Navigate to Developer Keys from Admin screen 18 | - Select the + Developer Key and choose + API Key 19 | - Set a name (Ex: Microsoft Power Automate) 20 | - Set an owner email 21 | - Set redirect URI to https://global.consent.azure-apim.net/redirect 22 | - Keep Client Credentials Audience as Canvas 23 | - Optionally enforce scoping (Scopes will have to be declared on Power Automate side during setup) 24 | - Select Save 25 | - Make a note of the Client ID and Client Secret. 26 | 27 | ## Setting up the Custom Connector in Microsoft Power Automate 28 | 29 | - Optionally upload an icon 30 | - Optionally set a background color 31 | - Update the description 32 | - Update the host to your Instructure URL (canvas.instructure.com) 33 | - Select Security to move to the next part of the setup 34 | - Keep Authentication Type as OAuth 2.0 and Identify provider as Generic OAuth 2 35 | - Provide the Client ID and Client Secret from the Canvas Developer Key steps above 36 | - Ensure that the Authorization URL points to your Canvas subaccount: https://canvas.instructure.com/login/oauth2/auth 37 | - Ensure that the Token URL points to your Canvas URL: https://canvas.instructure.com/login/oauth2/token 38 | - Ensure that the Refresh URL points to your Canvas URL: https://canvas.instructure.com/login/oauth2/token 39 | - Supply the scope information if you set specific endpoints when the developer key was created in Canvas 40 | - Make note of the Redirect URL. My instance of Microsoft Power Automate produced this URL: https://global.consent.azure-apim.net/redirect If your URL is different, ensure that the correct one is loaded into the developer keys redirect URL. This URL will not generate until you save the connector. 41 | - Select Definitions to move to the next part of the set up 42 | 43 | ## Checking Definitions 44 | 45 | - The Open API file loaded 13 Canvas API Endpoints: 46 | - Create Page 47 | - Create Module 48 | - Add contents to a module 49 | - Update Module 50 | - Course Menu Tools (Tabs positioning) 51 | - Create course 52 | - Create section 53 | - Create users 54 | - Get section information 55 | - Copy a Course 56 | - Get User Information 57 | - Check progress of a job 58 | 59 | Note: If you need additional endpoints, you can add them Under Actions -> New Actions -> Import from Sample. Set the verb GET, PUT, POST, or DELETE. Provide the JSON body and select import. Repeat these steps for the response. 60 | 61 | ## Test the Connection 62 | 63 | - Prior to moving to Step 5, save the connector by select the Create connect button. If you previously saved, this button will be called Update connector. 64 | - With the connector saved, navigate to Step 5 - Test. 65 | - Create a new connection. This will launch Canvas and have a familiar workflow to other apps where it requests permission to continue. 66 | - With a connection established, you can check to see if the connector was successful. Use a get operation like USER-CREATE to see if a user search appears. 67 | 68 | 69 | With these steps complete, the connector can now be used in Microsoft Power Automate. 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Canvas 2 | Canvas Tips 3 | --------------------------------------------------------------------------------