get_appointment_groups is broken
Describe the bug
get_appointment_groups API is broken.
To Reproduce
Steps to reproduce the behavior:
- Go onto Canvas, create an appointment group
-
canvas.get_appointment_groups()does not yield results (ie. it is empty)
Although, canvas.get_appointment_group(id=id) does work as expected.
Expected behavior
canvas.get_appointment_groups() should not return an empty array and should return the appointment group obj.
Environment information
- Python version (
python --version) Python 3.12.4 - CanvasAPI version (
pip show canvasapi) 3.3.0
Additional context
I couldnt get create_appointment_group to work properly as well (cannot create appointment), not sure if it is related.
Can you try a couple things?
- When you try to use
canvas.create_appointment_group, are you passing it a course context code? This is required according to the Canvas docs. A sample of your script may help identify the problem. - When you request appointment groups, are you passing it a scope? If the scope is missing, Canvas defaults to "reservable," but if there are none, it would result in an empty list.
I have followed your suggestions and have managed to make it work. Thanks so much!
Do you mind explaining what you ended up doing? This may be something that could be cleared up by some more information being added to the docs.
Ping @eric-vader - Any update on what you did to get it to work? If it was one of those request parameters, it might be worth documenting.
For create_appointment_group i could get it to work after adding the appointment_group['new_appointments']['0']=...
For get_appointment_groups needed the context code which was f'course_{course_id}' along with scope='manageable' to list as expected.
Thanks. I am going to mark this as a bug because the context_code param should be required. Hopefully I can get a patch in this weekend.