Ways to retrieve a list of course objects based on a given criteria.

Jump to solution
rrk35
Community Novice

I have been attempting to retrieve a list of courses based on a set of a course names via the api method,

GET /api/v1/search/all_courses

This method consistently resulted in an error and thus I reached out to Canvas support and they confirmed that indeed there is a bug and as of yet they do not have a timeline for a fix (see ticket #1564367).

Currently we a creating/provisioning courses by uploading a flat-file to the sis import endpoint. This method leaves our system with no knowledge of the Canvas' assigned course id for the created/provisioned courses. In order to update a course attributes in retrospect via the api method, update a course, one needs to know the course's Canvas assigned course id. Since I cant retrieve the Canvas course objects and thus obtain the Canvas course id via the api method, search/all_courses, due to the aforementioned bug I would like to know if there is another api method call or other automated way to retrieve Canvas course objects/ids based on a course name in a programmatic fashion?

Thank you for any suggestions and or help

1 Solution
hagimotk
Community Novice

Hi Rebecca,

If you're doing a SIS Import, your course has a required SIS ID for each course.  You can use "sis_course_id:SIS ID" instead of the canvas-assigned internal ID to retrieve courses.

For example, our SIS ID format for courses is something like this:  TST_100_001_U2015, and it's URL in Canvas may be

your_institution.instructure.com/courses/1527386

This is equivalent to saying

your_institution.instructure.com/courses/sis_course_id:TST_100_001_U2015

This works in API calls as well.

Not sure if this works for your situation, but we have not needed to store internal Canvas ID for our use at the institution.  Also the internal Canvas ID changes when course gets reset, so you'd have to know to re-get the ID when that happens.

Hope this helps,

Kumi

View solution in original post