Create non-editable calendar events using the REST API

96 views
Skip to first unread message

Ernst Widerberg

unread,
Oct 13, 2021, 9:34:30 AM10/13/21
to Canvas LMS Users
Hello,

I am looking for a way to create non-editable events in Canvas using the REST API.

From reading the API documentation and studying the source code, it seems like setting the property "workflow_state" to "locked" on a CalendarEvent object would achieve this.

Is this correct? If so I'd like to attempt a pull request to add an API argument for workflow_state. Would also appreciate any other suggestions for how this could be implemented from someone with knowledge of the code base.

Best regards,
Ernst Widerberg

anagp

unread,
Nov 2, 2021, 4:37:33 AM11/2/21
to Canvas LMS Users
I do not know if this achieves what you want. 

// Current state of the event ('active', 'locked' or 'deleted') 'locked' 
// indicates that start_at/end_at cannot be changed (though the event could be 
// deleted). Normally only reservations or time slots with reservations are 
// locked (see the Appointment Groups API)

This means that the event can still be deleted and are is some way "editable".

Best Regards,
Ana G. Pino

Ernst Widerberg

unread,
Nov 4, 2021, 4:42:24 AM11/4/21
to Canvas LMS Users
Yes, thank you, that is exactly what I'm asking about. My issue is that "workflow_state" is a property on event objects, but it is not available as a parameter for the "Create a calendar event" API endpoint.

I've noted that there is another API endpoint "Create or update events directly for a course timetable" which accepts an array of event objects (which would presumably allow me to set workflow_state directly). But this is tied to "timetable events" which as far as I can tell are weekly repeating events – not what I want. I've actually been unable to find any more documentation about "timetable events" and from experimenting with this API endpoint have not had any success with creating such events.

Best,
Ernst

Reply all
Reply to author
Forward
0 new messages