通过Graph创建EducationClass时,无法创建班级分配

时间:2018-08-06 13:01:11

标签: microsoft-graph microsoft-graph-edu

我创建了2个educationClass

    通过Microsoft Graph创建的描述为 Test100
  • educationClass
  • 由Teams应用创建的
  • educationClass,其描述为 Test

教育类 Test100 是使用POSThttps://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创建的班级。

对我来说,似乎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": "Test100-3099@wisad.be",
  "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对“团队”中创建的课程的响应:

{
  "@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:Test92@mydomein.be", "SMTP:Test92@mydomain.be"],
  "renewedDateTime": "2018-08-06T11:56:52Z",
  "resourceBehaviorOptions": [
    "HideGroupInOutlook",
    "WelcomeEmailDisabled",
    "ConnectorsDisabled",
    "SubscribeNewGroupMembers"
  ],
  "resourceProvisioningOptions": [],
  "securityEnabled": false,
  "visibility": "HiddenMembership",
  "extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType": "Section"
}

请注意,两个组的creationOptionsresourceBehaviorOptions不同。

当我尝试向GRAPH API创建的教育班级添加新作业时,出现以下消息:“正在设置教育班级”

enter image description here

2 个答案:

答案 0 :(得分:2)

您的观察被发现了。分配Api(当前在Graph Beta中)并未读取所有可能表示类类型的属性。 (creationOptions和可以标记为组的另一个扩展属性是类类型。要标记的确切属性取决于组的创建时间以及创建方式。)

我们正在研究修复程序,并在本周进行修补。 谢谢

答案 1 :(得分:1)

有必要发送术语开始日期和结束日期。

"term":{  
      "displayName":"Term2",
      "externalID":"2",
      "startDate":"2017-09-01",
      "endDate":"2019-08-31"
   }