canvas-lms
canvas-lms copied to clipboard
API: Calendar Event creation returns 404 if context_code is not supplied
When creating a calendar event via a form POST, context_code is marked as required. If it is not supplied, Canvas returns a 404 error. It seems like this should be either a 400 or more likely a 422 error.
Steps to reproduce:
curl 'https://<canvas>/api/v1/calendar_events' \
-X POST \
-F 'calendar_event[title]=Test Event' \
-F 'calendar_event[start_at]=2018-12-23T21:00:00Z' \
-F 'calendar_event[end_at]=2018-12-23T22:00:00Z' \
-H "Authorization: Bearer <token>"
I will also note that while context_code
is the only thing marked as required in the API documentation, you must also supply at least one other piece of information or it returns a 400 error. I have successfully created events with a context_code plus a title OR a start OR end time but at least one other parameter must be supplied.
Thanks for contributing to this issue. As it has been 2 years since the last activity, we are automatically closing the issue in 30 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or post a message on the mailing list. We'll gladly take a look again!
Just checking in... Nothing has changed about the behavior or documentation described in this issue.