Leading through Chaos - Insights and Actions • Browse the resources from the keynote presented by the Academic Strategy Team.
I am using the Update a Course API to attempt to update a course_code (the course's shortname).
https://canvas.beta.instructure.com/doc/api/courses.html#method.courses.update
Using Postman, it builds this request (I am using PUT as specified):
https://uccs.instructure.com/api/v1/courses/:id?course_code='New course code set by API'
There are no errors returned, but the course code does not change either. It returns the course object - no changes.
Anyone been able to get anything under update a course to work? I tried some other fields but they don't update either.
Solved! Go to Solution.
Something like this works for me:
https://yourschool.instructure.com/api/v1/courses/id?&course[course_code]=SampleNewCourseCode
Note: the sample course code is not in quotes.
You could try running your script in the Canvas Live API before postman...
Something like this works for me:
https://yourschool.instructure.com/api/v1/courses/id?&course[course_code]=SampleNewCourseCode
Note: the sample course code is not in quotes.
You could try running your script in the Canvas Live API before postman...
Thanks, I think this and Jame's answer are exactly what I need. But what do you mean by "Canvas Live API"? Is that where you login as a user with privileges and then try this in the browser?
Canvas Live API resides at <yourCanvasInstance>/doc/live/api
You will need an API access token, but it shows the different APIs and endpoints, explains the information required and returned, and allows you to then test it out. You can then see the request that was sent so you can duplicate it on your end.
The information in the Live API is pulled from the source code, just like the REST API documentation, but sometimes it's easier to see exactly what Canvas is sending than it is to figure out what the documentation says.
Buried in Brian's ( @BrianLester ) answer is the key. There is no course_code parameter. There is a course[course_code] parameter.
If you're going to use JSON, which makes the structure clearer, it would be
{
"course" : {
"course_code" : "new course code"
}
}
This is a common misunderstanding -- I've responded to similar issues several times in the last couple of weeks. When you look at the example requests at the bottom of the Update course endpoint, you will see the course[name] and course[start_at]. Those examples provide suggestions about how the call should be made.
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.