Based on the metadata (https://graph.microsoft.com/beta/$metadata), the correct namespace and type should be microsoft.graph.educationAssignmentGradeType
. This also aligns with the JSON representation in the Graph documentation:
json
{
"id": "String (identifier)",
"addedStudentAction": "none",
"addToCalendarAction": "string",
"allowLateSubmissions": true,
"allowStudentsToAddResourcesToSubmission": true,
"assignDateTime": "String (timestamp)",
"assignTo": {"@odata.type": "microsoft.graph.educationAssignmentRecipient"},
"assignedDateTime": "String (timestamp)",
"classId": "String",
"closeDateTime": "String (timestamp)",
"createdBy": {"@odata.type": "microsoft.graph.identitySet"},
"createdDateTime": "String (timestamp)",
"displayName": "String",
"dueDateTime": "String (timestamp)",
"grading": {"@odata.type": "microsoft.graph.educationAssignmentGradeType"},
"instructions": {"@odata.type": "microsoft.graph.itemBody"},
"lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"},
"lastModifiedDateTime": "String (timestamp)",
"notificationChannelUrl": "string",
"status": "string",
"webUrl": "string",
"resourcesFolderUrl": "string"
}
POST https://graph.microsoft.com/beta/education/classes/574f3a2d-debe-4bdb-8065-4270ccd5c5f3/assignments
Headers:
Host: "https://graph.microsoft.com/"
Content-Type: "application/json"
Authorization: "Bearer <removed_for_security>"
SdkVersion: "Graph-php-1.34.0"
Body:
{
"displayName":"test",
"instructions":{
"contentType":"text",
"content":""
},
"dueDateTime":"2021-07-09T22:59:00Z",
"assignDateTime":"2021-07-08T07:30:00Z",
"grading":{
"@odata.type":"#microsoft.education.assignments.api.educationAssignmentPointsGradeType",
"maxPoints":100
},
"status":"draft"
}
Same problem here:
"Invalid OData type specified: \"microsoft.education.assignments.api.educationAssignmentPointsGradeType\"",
POST {beta or v1.0}/education/classes/{my class id}/assignments
When I change these @odata.type to : microsoft.graph.educationAssignmentPointsGradeType
and microsoft.graph.educationAssignmentRecipient
Then I got " code : 20132, The content of the request is invalid. Common causes are an invalid Content-Type header(truncated...) "
Any solutions?
@Diana Wanjuhi Please could you advise of a solution. It has now been over a week with no progress made!
Sign in to comment