我创建了 2 个 educationClass
:
- 通过 Microsoft Graph 创建的具有描述 Test100 的educationClass
- educationClass,其描述为由 Teams 应用创建的测试。
教育类Test100是使用POST
创建的https://graph.microsoft.com/V1.0/education/classes带有以下 JSON 对象
{
"displayName": "Test100",
"description": "Test100",
"externalId": "3099",
"mailNickName": "Test100-3099"
}
使用POST
将教师添加到
https://graph.microsoft.com/V1.0/education/classes/ID-Education-Class/teachers/$ref带有以下 JSON 对象
{
"@odata.id": "https://graph.microsoft.com/V1.0/education/users/teacher-ID"
}
使用 POST
将成员添加到
https://graph.microsoft.com/V1.0/education/classes/ID-Education-Class/members/$ref带有以下 JSON 对象
{
"@odata.id": "https://graph.microsoft.com/V1.0/education/users/ID-Member"
}
当我想在 Teams 应用程序中分配作业时,它适用于通过 Teams 创建的 educationClass,但不适用于通过 Graph 创建的类(class)。
对我来说,Graph 创建的 educationClass 的 Group 属性中似乎缺少一些内容。
来自 GET GROUP
的针对 API 创建的类的响应:
{
"@odata.context": "https://graph.microsoft.com/V1.0/$metadata#groups/$entity",
"id": "cd5a64f4-8784-4356-8c04-31deb1aa6849",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2018-08-06T08:36:28Z",
"creationOptions": [],
"description": "Test100",
"displayName": "Test100",
"groupTypes": ["Unified"],
"mail": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="34605147400504041907040d0d74435d4755501a5651" rel="noreferrer noopener nofollow">[email protected]</a>",
"mailEnabled": true,
"mailNickname": "Test100-3099",
"onPremisesLastSyncDateTime": null,
"onPremisesProvisioningErrors": [],
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": ["smtp:Test100-3099@mydomein", "SMTP:Test100-3099@mydomein"],
"renewedDateTime": "2018-08-06T08:36:28Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": ["Team"],
"securityEnabled": false,
"visibility": "HiddenMembership",
"extension_fe2174665583431c953114ff7268b7b3_Education_SyncSource_SectionId": "3099",
"extension_fe2174665583431c953114ff7268b7b3_Education_CreatedByUserId": "myuserid",
"extension_fe2174665583431c953114ff7268b7b3_Education_CreatedByAppId": "MyAppID",
"extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType": "Section"
}
来自 GET GROUP
对 Teams 中创建的类的响应:
{
"@odata.context": "https://graph.microsoft.com/V1.0/$metadata#groups/$entity",
"id": "e971cfd4-dc4c-4321-ae51-4d216557bec8",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2018-08-06T11:56:52Z",
"creationOptions": ["classAssignments", "ExchangeProvisioningFlags:2509"],
"description": "Test",
"displayName": "Test",
"groupTypes": ["Unified"],
"mail": "Test92@mydomain",
"mailEnabled": true,
"mailNickname": "Test92",
"onPremisesLastSyncDateTime": null,
"onPremisesProvisioningErrors": [],
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": ["smtp:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b1e5d4c2c58883f1dcc8d5dedcd4d8df9fd3d4" rel="noreferrer noopener nofollow">[email protected]</a>", "SMTP:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90c4f5e3e4a9a2d0fde9f4fffdf1f9febef2f5" rel="noreferrer noopener nofollow">[email protected]</a>"],
"renewedDateTime": "2018-08-06T11:56:52Z",
"resourceBehaviorOptions": [
"HideGroupInOutlook",
"WelcomeEmailDisabled",
"ConnectorsDisabled",
"SubscribeNewGroupMembers"
],
"resourceProvisioningOptions": [],
"securityEnabled": false,
"visibility": "HiddenMembership",
"extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType": "Section"
}
请注意,两个 Group 的 creationOptions
和 resourceBehaviorOptions
是不同的。
当我尝试向 GRAPH API 创建的教育类(class)添加新作业时,我收到以下消息:“正在设置教育类(class)”
最佳答案
有必要发送学期开始日期和结束日期。
"term":{
"displayName":"Term2",
"externalID":"2",
"startDate":"2017-09-01",
"endDate":"2019-08-31"
}
关于microsoft-graph-api - 通过图表创建 educationClass 时无法创建类(class)作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51708290/