我在Microsoft Graph中调用List Assignments端点。它返回一个类的数组,其中有一个类如下图所示。
我如何解包引用的实体 microsoft.graph.educationAssignmentClassRecipient
来获取收件人列表?
{
"classId": "bef6024d-c51d-4c2d-9c4c-4e290581e7b4",
"displayName": "Teleschool Week 5 Formative Grade",
"closeDateTime": null,
"dueDateTime": "2020-04-28T03:59:59Z",
"assignDateTime": null,
"assignedDateTime": "2020-04-24T15:51:00.8911402Z",
"allowLateSubmissions": true,
"createdDateTime": "2020-04-24T15:50:39.9443371Z",
"lastModifiedDateTime": "2020-04-24T15:51:03.7407937Z",
"allowStudentsToAddResourcesToSubmission": true,
"status": "assigned",
"id": "66e4a8f8-42ee-49e0-9503-e24a49be6908",
"instructions": {
"content": "",
"contentType": "text"
},
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 100
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
}
educationAssignmentClassRecipient {pasted from documentation}。
在assignment.assignTo属性中使用。当设置为类收件人时。全班同学 将在作业发布时收到一个提交对象。
这个资源是educationAssignmentRecipient的一个子类。
对于向全班同学发放的作业,它将包含classRecipient数据类型。
对于classRecipient,我们不包含完整的userIds列表。但你可以查询 ~/groups/{classId}/members
API来获取成员列表,或者查看到底是哪些用户被分配了任务,你可以通过查询 ~/assignments/{id}/submissions
列表,其中每份呈件将包含 recipient/userId
属性。
对于一个有选择地发放给学生子集的作业,它将包含@odata.type.IndividualRecipient和一个包含学生userIds的收件人数组。IndividualRecipient 和一个包含学生用户ID的收件人数组。