Calendar API: How to retrieve course events between specific dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019
02:05 PM
I've been doing a lot of testing with the calendar api and am stuck on how to retrieve events for a course between specific dates. I'm thinking there may be a bug.
I created a bunch of events (using the API) between 9/5/2019 and 10/17/2019. Looking at https://canvas.instructure.com/doc/api/calendar_events.html#method.calendar_events_api.index, I am only able to retrieve events if I used "all_events": true:
Call: GET /api/v1/calendar_events
The following returns nothing:
{
"context_codes": ["course_12345"],
"start_at": "2019-09-03",
"end_at": "2019-10-05"
}
This returns all the events posted for the course:
{
"context_codes": ["course_12345"],
"all_events": true
}
Do I have an error in the first JSON body or is this a bug?