Hi,
I'm trying to use the PUT method with /d2l/api/le/(version)/(orgUnitId)/content/modules/(moduleId) endpoint. According to Brightspace API Reference, the payload shoul be a ContentObjectData, with the following fields:
{
"Title": <string>,
"ShortTitle": <string>,
"Type": 0,
"ModuleStartDate": <string:UTCDateTime>|null,
"ModuleEndDate": <string:UTCDateTime>|null,
"ModuleDueDate": <string:UTCDateTime>|null,
"IsHidden": <boolean>,
"IsLocked": <boolean>,
"Description": { <composite:RichTextInput> }|null,
"Duration": <number>|null // Available in LE's unstable contract
}
And RichTextInput is:
{
"Content": <string>,
"Type": "Text/Html"
}
I tried calling the API with different parameter values, including default values (i.e. null, true, false or ""), but I always receive a status code 400 with the following response:
{
"type": "http://docs.valence.desire2learn.com/res/apiprop.html#json-binding-error",
"title": "JSON Binding Error",
"status": 400,
"detail": "Provided JSON is invalid or does not match the expected format."
}
The payload I'm using is (in Python):
data = {
"Title":" <string>",
"ShortTitle": "<string>",
"Type": 0,
"ModuleStartDate": None,
"ModuleEndDate": None,
"ModuleDueDate": None,
"IsHidden": False,
"IsLocked": False,
"Description": None,
"Duration": None
}
When I call the same endpoint with GET method, everything works fine.
Does anyone have any clue?
Thks,
Gerson