API GET /api/v1/courses/:course_id/content_migrations returns blank array

Jump to solution
RanjeetSingh
Community Member

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
0 Likes
1 Solution
stimme
Community Coach
Community Coach

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

View solution in original post