I'm working on a google sheet that will allow me to manage announcement publish dates in bulk. It should work similarly to James Jones extension Adjust All Assignment Dates on One Page as well as the spin-off version bulk editor I created a few weeks ago: Canvas Bulk Date Editor (Google Sheet). I'm simply altering the work to be able to adjust announcement dates.
I have managed to GET the announcements via the discussion API using only_announcements=1 as the parameter. I can alter the dates and prepare the return API call to send the new dates back to Canvas, but I can't figure out why they do not get updated in Canvas.
I'm sure it's related to the API, so maybe someone here can point me in the right direction.
Starting with James' original sheet, the payload (parms) looks like this:
My payloads look like this:
The url looks like this:
The next script line is this:
var response = UrlFetchApp.fetch(url, parms);
Which seems to return the original announcement without any changes.
I'm using the original canvasAPI.gs that James created and it works for quizzes and assignments. From the way I understand URLFetchApp works, it should POST the parameters to the URL in Canvas, right?
Is there any way to debug what's happening when Canvas receives the https request?
You are welcome to look at the google doc here: