API GET /api/v1/courses/:course_id/content_migrations returns blank array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm trying to write a script to download Migration Exception Logs for ~200 courses. My plan is to use the endpoints below to get the list of courses, get the Migration Exception Log for each course, and load that in Power BI. That will allow us to follow up on errors, join to Kaltura data, and generally project manage things. Getting the list of courses was no problem, but the GET to content_migrations with a valid course_id returns no data. I get a status of 200 OK, but the payload is a blank array, "[]". I can see the Migration Exception Log for the course at https://jhu.instructure.com/courses/1188/pages/000-migration-exception-log so it's not a permissions issue. Any ideas why /api/v1/courses/<course_id>/content_migrations returns no data?
endpoints:
- Courses -> /api/v1/courses
- Content migrations -> /api/v1/courses/<course_id>/content_migrations
- Migration issues -> /api/v1/courses/<course_id>/content_migrations/<content_migration_id>/migration_issues
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @RanjeetSingh ,
I think the most likely explanation is that the payload for https://jhu.instructure.com/api/v1/courses/1188/content_migrations is a blank array because the course has no content migrations. The URL you mentioned - https://jhu.instructure.com/courses/1188/pages/000-migration-exception-log - is not where Canvas would display content migrations normally. This URL indicates some user created a page in the course showing some migration exception log, most likely copied & pasted. Course 1188's own content migrations would be at https://jhu.instructure.com/courses/1188/content_migrations.
I tested the API with a course of my own that did contain content migrations, and I'm getting the same info in the GUI & API. I hope this helps.
Sam