Create Course with API

Jump to solution
jdmendoza
Community Novice

When I'm creating the course through the API, I can't get the sis_course_id to persist and when I check the database sis_source_id is empty even though I'm passing the course[sis_course_id] on the data to post, it picks up everything else, so what am I missing?

Post body:

post-data.png

Post Result:

post-result.png

Thanks

1 Solution

Before I attempt to help further, I would like to note that I am, most definitely, not a software engineer. I'm just a normal Canvas admin. But maybe someone else can chime in if I butcher this! :smileygrin:

"Manage SIS data" is an account level role and not a course level role. I believe you would need an administrator token to accomplish your task. I'm not 100% sure on this though.

If you are building a course creation tool for a teachers, you could leave out the part about sis_course_id and do that as a separate call using an administrator token. Maybe something like this:

  1. POST to create the course without sis_course_id using the teacher's role.
  2. Store the returned "id" field into a variable.
  3. PUT the sis_course_id into the course using an administrator token and the course id variable that was returned in Step 1.

I'm probably missing a much more elegant solution than this, but I'll let someone smarter than me weigh in on that.

View solution in original post