PUT, POST etc don't really take array parameters
mylescarrick opened this issue · 0 comments
I'm trying to call the update courses API
https://canvas.instructure.com/doc/api/courses.html#method.courses.batch_update
It needs a courses_id param... but because the clean_params doesn't yet handle array values (see note at https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L177) I'm trying to do what the docs suggest, and send an array of arrays...
... but put, post, delete methods assume a hash (https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L150) - so they pass a string/symbol key... so they fail (of course) with:
TypeError: no implicit conversion of String into Integer
I might take a look at the clean_params implementation - or in the meantime it might be worth updating the docs, as the examples there won't work.