API Documentation Issue

Jump to solution
jhveem
Community Explorer

The api documentaiton for blackout dates for putting / posting currently implies parameters are all at the top level of the object. Like this

{

start_date: DATE

end_date: DATE

}

However, this doesn't work. It does work if it's wrapped in a blackout_date.

{

blackout_date: {

start_date: DATE

end_date: DATE

}

}

 

Here's where I'm referring to:

https://canvas.instructure.com/doc/api/blackout_dates.html

0 Likes
1 Solution
michael_william
Community Participant

I think I have the solution for you. To create a blackout date you must use POST in the following format for the data field (Python):

data = {

  'blackout_date': {

    'start_date': DATE,

    'end_date': DATE,

    'event_title': TITLE

  }

}

requests.post(URL, params=payload, json=data)

View solution in original post

0 Likes