Showing results for 
Search instead for 
Did you mean: 
Community Contributor


Jump to solution

I have some programming experience in VBA and Access SQL and was hoping to join your developers forum to get tips on where to start programming the building blocks in Canvas. For instance Blackboard uses JAVA whereas I gather, from the limited video clips I have seen, Canvas uses JSON. I am looking to take things from inception to the API integration stage. If anyone could offer some advice and guidance as to where I should start, would be much appreciated.


Tags (1)
47 Replies

For (1), you should be POSTing to:

The POST isn't part of the URL, its the http method (like GET, PUT, PATCH, DELETE).

Community Contributor

Hi Peter, thanks for this.

I created three test 2018 course shells (one in the example below: 2018-Brickwork) by SIS import.

I note from Garth's addition that parameter source_course, but I don't see anywhere in the documentation where this is or where it is applied.

I attempted the following combinations however, based on some supposition and guidance from yourself and Garth. Again I received a Page not found response:

Thinking it will need the new course in there, I tried this. 

I note from the video API Calls Made Simple by Curtis Rose, that a Token is required that is placed within the Call. The video says the token can be acquired through Account Settings under "Approved Integrations". The nearest label I could find resembling this is something called  "Trusted HTTP Referers".

Furthermore there is no mention of the Access Token requirement within the Call documentation.

What am I doing wrong?


Community Participant

David, @de_millington 

I just started using PowerShell to make API calls within Canvas, and I was confused at first. Here’s a couple of things that made it easier for me to understand how the process works. When first starting out with the API, this Canvas API guide was very helpful. I would use your institution’s Live API to build the URL. https://<Your_Institutuion> After changing this link to match your institution, it should show the live API area. The Canvas guide above talks about using the Live API as well.

You can get the access token by following this guide:

Before running any API calls on production, make sure you test them on the Beta and Test instances. I would also make sure you know what every line of code does before running it.

This is how a very basic API GET call within PowerShell 5.1 looks:


$token = "Your token here"
# the headers area stays the same
$headers =@{"Authorization"="Bearer "+$token}
$url = "Your URL within this field"

Invoke-RestMethod -Method Get -Headers $headers -Uri $url

I would also read about the GET, POST, and PUT API calls. GET gathers information of some kind while POST and PUT make changes. When I first started, I made several GET calls to learn how the process worked before trying to make any changes to the Beta instance.

Community Champion

 @de_millington  all API calls are documented, Copy course content can be found here

I have copied a specific section of that documentation below, and highlighted "source_course" as bold text.

It's the first parameter defined under the "Parameter" column below.

You can also search this page for source_course to find the definition.

If you are going to work with the API, I strongly recommend getting comfortable with the documentation available from Canvas.

Start here: The Basics and scroll down all of the options in the left panel to explore the API and get comfortable with how it is organized.

I hope this helps.

Copy course contentContentImportsController#copy_course_content

POST /api/v1/courses/:course_id/course_copy

Scope: url:POST|/api/v1/courses/:course_id/course_copy

DEPRECATED: Please use the Content Migrations API

Copies content from one course into another. The default is to copy all course content. You can control specific types to copy by using either the 'except' option or the 'only' option.

The response is the same as the course copy status endpoint

Request Parameters:


ID or SIS-ID of the course to copy the content from


A list of the course content types to exclude, all areas not listed will be copied.

Allowed values:course_settings, assignments, external_tools, files, topics, calendar_events, quizzes, wiki_pages, modules, outcomes


A list of the course content types to copy, all areas not listed will not be copied.

Allowed values:course_settings, assignments, external_tools, files, topics, calendar_events, quizzes, wiki_pages, modules, outcomes

Community Contributor

OK I'm a little further on thanks to you Garth and Samuel (please don't turn off the drip feeds :smileyblush: !).

So you can see the latest fruits of my labours in the added screen shots.

Token application


API response

OK so I generated the token twice, once in the live area, once in the Beta. I copy/pasted those tokens to the beta site (top image) :https://<Your_Institutuion> and then applied course_id, source_course_id, and migration type (assumed to be copy_course_importer, as this is only one that seems to chime with the manual course copies we perform through the UI). Finally I selected Try it Out! Like I said I got an error response 404 on both attempts).

Question1: How does Canvas know which API applies to which token? Is it related to the law of corresponding actions: i.e. save a token and the next API that is tried in the sequence engages with that token?

Question2: Is this site https://<Your_Institutuion> with all its embedded REST APIs with Try it Out! buttons a simulation or a real-time (be that Beta or live site) POST?

Question 3: Given what I have presented, can someone please account for the error?

Thanks in advance.

Community Champion

 @de_millington ‌ I have never tried to test the API calls using the reference you have given.

The tool I use is Postman, take a look at this post:  API Testing: Postman

Let me know if that helps.

I think you need to use the canvas course id's, not the sis id's...


View solution in original post

Community Contributor

Thankyou Jaap Stelstra . I'd offer you a virtual cigar or glass of champagne if there was one.

After doing some cartwheels through the office in my excitement, it only then occurred to me that this feature works for one course at a time. What then does one do with 600 plus courses? It seems to me that this technique is more laborious than doing a manual course copy, since the Token will also have to be generated 600 plus times.

I'm wondering if anything can be done with the response body or header code (body code shown below)?

Request url: 

Response Body:

  "id": 6753,
  "user_id": 59,
  "workflow_state": "running",
  "started_at": "2018-08-09T15:25:44Z",
  "finished_at": null,
  "migration_type": "course_copy_importer",
  "created_at": "2018-08-09T15:25:44Z",
  "migration_issues_url": "",
  "migration_issues_count": 0,
  "settings": { "source_course_id": 77, "source_course_name": "Workforce Development", "source_course_html_url": "" },
  "progress_url": "",
  "migration_type_title": "Course copy" }

Community Contributor

Hi Garth, This is helpful. I have managed to download the app and have begun looking at some tutorials on YouTube.

As you can see from my response to Jaap, his advice paid off in terms of getting the Canvas API to work with my institution. The downside is that this API generator works for one course copy at a time. While I have requested further incites to leveraging this feature on multiple courses, I have my doubts this can be pursued further since there is nothing indicative of this in the literature.

Having some sort of spreadsheet with course codes and source codes seems to me to be the minimum mandatory requirements, but how would this fit into an API? Are there any resources that you can point me to that indicate how to leverage a Postman API to work for multiple courses?

Hi  @de_millington ‌, API calls are usually not used as a single command or action, most of the time it will be multiple Get call, maybe also Put, Post or Delete calls to get done what you need. The Live API you experimented with is meant for exploring the API possibilities and sometimes to just quickly perform some changes using data from reports from Canvas, but it was never intended as a full production tool (at least how I interpreted it). To understand what the API can offer you and to know what you need to prepare and process the data, take a look at 

Hopefully that is helpful to you.