问题
I created 2 educationClass
:
- educationClass with description Test100 created via Microsoft Graph
- educationClass with the description Test created by the Teams app.
The educationclass Test100 is created using a POST
to https://graph.microsoft.com/V1.0/education/classes with the following JSON object
{
"displayName": "Test100",
"description": "Test100",
"externalId": "3099",
"mailNickName": "Test100-3099"
}
Teachers are added using a POST
to
https://graph.microsoft.com/V1.0/education/classes/ID-Education-Class/teachers/$ref with the following JSON object
{
"@odata.id": "https://graph.microsoft.com/V1.0/education/users/teacher-ID"
}
Members are added using a POST
to
https://graph.microsoft.com/V1.0/education/classes/ID-Education-Class/members/$ref with the following JSON object
{
"@odata.id": "https://graph.microsoft.com/V1.0/education/users/ID-Member"
}
When I want to assign an assignment in the Teams app, it works fine with the educationClass created via Teams but not for the class created via Graph.
To me, it seems there is something missing in the Group properties for the educationClass created by Graph.
Response from GET GROUP
for the class created by the 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"
}
Response from GET GROUP
for the class created in 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: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"
}
Notice that the creationOptions
and resourceBehaviorOptions
of the two Groups are different.
When I try to add a new assignment to education classes created by the GRAPH API, i get the following message saying: "Education class is being setup"
回答1:
It is necessary to the send the Term startdate and enddate.
"term":{
"displayName":"Term2",
"externalID":"2",
"startDate":"2017-09-01",
"endDate":"2019-08-31"
}
回答2:
Your observations were spot on. The assignments Api (currently in Graph Beta) were not reading all the possible properties that could denote a class type. (creationOptions and another extension property which can be stamped to signal the group is a class type. Exactly which property get stamped is dependent on when the group was created and how).
We are working on a fix and getting it patched this week. Thanks
来源:https://stackoverflow.com/questions/51708290/not-possible-to-create-class-assignment-when-educationclass-created-via-graph