Using REST API to associate course to blueprint course

193 views
Skip to first unread message

Bill Lane

unread,
Jul 17, 2017, 7:26:57 PM7/17/17
to Canvas LMS Users
We are trying to automate the process of associating courses to blueprint courses.  The workflow we want to implement is to have a form in our website where the director of elearning submits a csv file which creates the associations.  We already have something similar for creating assignments.  To achieve this we are looking at "Update associated courses"  (https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.update_associations) but I assume we must be missing something simple because whatever we try it returns "The specified resource does not exist".  The documentation provides the following path :

PUT /api/v1/courses/:course_id/blueprint_templates/:template_id/update_associations


We're assuming the issue relates to the course or blueprint_template id.  It seems unlikely to me that the course id and the course_ids_to_add would be the same.  So should the course id be the blueprint course id?  If that is the case then what is the template_id and where would we find that?

https://somewhere.beta.instructure.com/api/v1/courses/5475/blueprint_templates/6641/update_associations?access_token=our_access_token&course_ids_to_add[]=5475

If anyone has any experience or insight into this it would be greatly appreciated.

N.B The above url is used in Postman and consequently it will make the necessary substitutions to ensure the url format is valid (e.g the ending will be &course_ids_to_add%5B%5D=5475 but have left as is for clarity).

Andrea Schmidt

unread,
Aug 17, 2017, 3:27:06 PM8/17/17
to Canvas LMS Users
Based on the testing I've done with this, replace :course_id with the id from the template course, currently you can use default for the :template_id, but you can also get the actual template_id

GET /api/v1/courses/:course_id/blueprint_templates/default

Reply all
Reply to author
Forward
0 new messages