我正在尝试从班级端点检索学生所属的所有学校:
https://graph.microsoft.com/beta/education/classes/{classId}/members?$expand=schools&$select=userPrincipalName,student,schools
属性学校显示在响应中,但始终为空:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.educationUser)",
"value": [
{
"userPrincipalName": "some@mail",
"student": {
"grade": "XXXXXXX",
"studentNumber": "XXXXXX"
},
"schools": []
},
{
"userPrincipalName": "some@mail",
"student": {
"grade": "XXXXXXX",
"studentNumber": "XXXXXX"
},
"schools": []
}
]
}
编辑:我确认该schools
物业对我来说总是空的。甚至教育用户端点也不再工作:
https://graph.microsoft.com/beta/education/users/{userId}?$expand=schools&$select=userPrincipalName,student,schools
.
这是我得到的错误:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/users(userPrincipalName,student,schools,schools())/$entity",
"userPrincipalName": "some@mail",
"student": {
"externalId": "XXXXXXX",
"grade": "XXXX",
"studentNumber": "XXXXX"
}{
"error": {
"code": "InternalServerError",
"message": "The entity instance value of type 'microsoft.graph.educationUser' doesn't have a value for property 'id'. To compute an entity's metadata, its key and concurrency-token property values must be provided.",
"innerError": {
"date": "2020-09-17T07:54:02",
"request-id": "d60fc284-e410-4e39-a2db-52cb1da5f0bf",
"client-request-id": "d60fc284-e410-4e39-a2db-52cb1da5f0bf"
}
}
}