Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Hello Everyone,
I'm developing an application that accesses course data from the Canvas API using the endpoint GET /api/v1/accounts/:account_id/courses
. After each sync, I need to pull all the courses for an institution into my application, which is causing API performance issues. To optimize this, I would like to fetch only the newly created and updated courses upon every sync. Is there a Canvas API that tracks when a course is created or updated, so I can retrieve only the new and updated data?
Your guidance on this would be greatly appreciated.
@test I think the short reply to your question is no.
You could write the script to get new courses only if you store the maximum course ID number from the last run, direct the API to return the newest courses by including the parameters order=desc & sort=course_id, then check the ID field against the max ID from the last run and end the loop when you get to it.
To broaden the conversation a little, I have questions:
In addition to what @stimme says, are you doing any processing of the data before the courses are being pulled into the application?
Potentially, if you can pre-process before you sync data into the application (like on a server or VM), could you simply do a diff between two pulls of a Provisioning report to grab any newly created courses and have your application just read off the diff file on a server somewhere?
In a nutshell, could you avoid hitting that endpoint and instead use a different way of getting the data that you need?
To participate in the Instructure Community, you need to sign up or log in:
Sign In