Open vishalgvk opened 9 months ago
I found the solution after multiple trials.
Solution: Send a PUT request to Course (but not CourseSettings) passing only image_id (image_url and image aren't required). In the response, even though the updated data doesn't appear, that's fine. We have to verify the updated image_id by making GET request to CourseSettings (but not Course).
So, this can be considered as a bug in canvas-lms api.
Thanks for this - this helped me set the images. I'm not sure this is a bug though as I've since found it is documented: https://github.com/instructure/canvas-lms/blob/3571f46bdf7ad07baa781335053e5f47fbd7a5c5/app/controllers/courses_controller.rb#L2984
Summary: Unable to update image of Course in CourseSettings using API
Steps to reproduce:
/api/v1/courses/:courseId/settings
with request body being{ "image_id": "1" , "image_url": _imageUrl_ , "image": _imageUrl_ }
Please let me know if it's possible to update image or bannerImage of Course using API