Why grade value update API gives 400 JSON Binding Error for a null grade update?
Hi All,
We are using the PUT API "/d2l/api/le/(version)/(orgUnitId)/grades/(gradeObjectId)/values/(userId)" to update an existing grade item with a null value.
We are passing the following JSON object in the request body.
{
"Comments": {
"Content": "Comments.",
"Type": "Text"
},
"PrivateComments": {
"Content": "Private comments",
"Type": "Text"
},
"GradeObjectType": 1,
"PointsNumerator": null,
"PointsDenominator": 45
}
When we submit the above request we are getting the following error:
{
"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."
}
Any idea on how to fix this error or how to pass a null value for the grade item?
Answers
-
Hello @Vinodya Bandara It looks like you will have to add numeric value in place of NULL, as you are updating grade value. But I will check back with dev for further Information.
Thanks
Priyanka
-
-
Hello @Vinodya Bandara In this API grade values can only be used as decimal or numeric number. NULL can not be used as you are trying to update given value( using PUT) you can use decimal or numeric number but not Null. Or you can use 0 if you would like to.
Thanks
Priyanka
-
Noted. Thank you for the update @Priyanka Pathak!