- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create Course with API
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 Result:
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- POST to create the course without sis_course_id using the teacher's role.
- Store the returned "id" field into a variable.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just tried your exact setup in my test instance and it worked. The sis_course_id was not null in the return object. Just grasping at straws here, but is it possible you're missing the permission to "Manage SIS Data"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to do it with the Teacher role, so that Teacher's can sync(create) their courses from the current SIS.
In order to create it with the sis_course_id the user would have to have the Administrator Role?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- POST to create the course without sis_course_id using the teacher's role.
- Store the returned "id" field into a variable.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That sounds like a viable solution. Do you know how to produce an admin token?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jdmendoza , I know WAY less than (the awesome) Matt Hanes, but I do know that to get an admin token you need a Canvas admin to generate it for you. Do you know who the Canvas Admin is for your Canvas Environment? If so, then that's the person to talk with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are the instructions for producing a token: How do I obtain an API access token for an account?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot @MattHanes & @kona !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I should also note that the token generation process takes the role of the person who generated the token.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which is why the Canvas Admin is needed.
