Sample payload for Put Grade
Hello,
I am doing a to /d2l/api/le/(version)/(orgUnitId)/grades/(gradeObjectId)/values/(userId) and I get this result
{ "PointsNumerator": 2.000000000, "PointsDenominator": 100.000000000, "WeightedNumerator": null, "WeightedDenominator": null, "GradeObjectIdentifier": "468", "GradeObjectName": "Yoga Exam", "GradeObjectType": 9, "GradeObjectTypeName": "Category", "DisplayedGrade": "2 %", "Comments": { "Text": "", "Html": "" }, "PrivateComments": { "Text": "", "Html": "" }, "LastModified": "2023-08-07T21:32:23.730Z", "LastModifiedBy": 0, "ReleasedDate": null}
But when I try to update the grade with this payload
{"Comments": {"Content": "Great job on the exam!" ,"Type": "Text"},"PrivateComments": {"Content": "Nice" ,"Type": "Text"},"GradeObjectType": 9,"PointsNumerator": 99.000000000,"PointsDenominator": 100.000000000}
I get this
{ "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 Ideas?
Answers
-
Hi Jonathan
Thank you for contacting us through community.
I see that you are making PUT call for :
/d2l/api/le/
(version
)/
(orgUnitId
)/grades/
(gradeObjectId
)/values/
(userId
)The Payload you mentioned is for GradeObjectType: Category ("GradeObjectType": 9,)
However, this action expects an IncomingGradeValue aligned with one of the first four grade object types as mentioned in this link
The Payload you have is of type 9 and so Put call cant be made for this type and that resulted in error you received.
You can read more about this call in below link
Thanks,
Sreelakshmi