@DOGutierrez
I don't use the Python library, but the code doesn't look right. You would likely need to create an object (maybe dictionary). I don't speak Python very well) so I won't be able to help convert the JSON into Python.
It looks like you may have been close with the course.update(end_at=date) attempt, but it looks like there is one piece missing.
The Update a Course endpoint is the one to use to set the date for a course. The end_at parameter should be an ISO8601 date, but there is a note in the documentation that says "This value is ignored unless ‘restrict_enrollments_to_course_dates’ is set to true." That's the piece that seems to be missing.
Perhaps. A possible reading of that is "We'll change the date, but it won't have any impact unless the enrollments are set to use the course dates".
It's also possible that your date is not in the proper format. I don't know how the Canvas Python library deals with datetime objects.
I haven't tested this, but I think this should work. Again, I cannot help with the Python.
The PUT statement should look something like this (change the course ID and date to what you need them to be):
PUT <instance>/api/v1/courses/1234?course[end_at]=2024-06-20T05:00:00Z&course[restrict_enrollments_to_course_dates]=1
As a JSON object, it would look like this:
{
"course" : {
"end_at" : "2024-06-20T05:00:00Z",
"restrict_enrollments_to_course_dates": true
}
}
@themidiman
The Canvas Mobile apps are built on the API. There are some internal commands from the web UI that do not use it, but if the apps support it, then it's likely in the API somewhere.