Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
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
Solved! Go to Solution.
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)
Did you ever get this to function correctly? I am unable to create or list blackout dates for course pacing using these API calls. When I pull a course that has blackout dates that are using course pacing, I get [] (empty) as the response. When I go to create dates, I get {'errors': [{'message': 'blackout_date is missing'}]}
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)
To participate in the Instructure Community, you need to sign up or log in:
Sign In