API PUT Statement to update course section names

Jump to solution
talway
Community Contributor

I am looking for some guidance.  The SIS import for Sections does not do what I need it to do so I am needing to write a program to update our course section names.  I have a basic level understanding of APIs.  Through the use of the Canvas Live API I was able to determine that what I want to do is possible. 

Using the Edit a Section Canvas Live API I am able to change a section name.  This works fine for one course but I need to update several hundred.  I took the information from the Live API and put it into POSTMAN so I could try and get a better understanding of what variables are needed.  From the API documentation I see that the variable name should be "course_section[name]".  However, I am not sure how to interpret that.  I tried several different iterations of this field name but none seemed to work.  I did confirm that I have a connection between POSTMAN and my Canvas Beta site.

I thought that the API PUT statement would be: https://myschool.beta.instructure.com:443/api/v1/sections/sectionid/?course_section[name]=NEW  NAME HERE  but that keeps returning an error message. 

Could someone please advise me on what I am missing to update the section name?

Thank you.

 

 

Labels (3)
0 Likes
1 Solution
agschmid
Community Contributor

Hello @talway ,

Have you tried adding a json body?

{"course_section":
{"name": "NEW_NAME"}}

View solution in original post

0 Likes