This will also create a universal group. When you use this API to create a class, it will add special properties to the group, which will add features such as assignments and special handling within Microsoft Teams when teams are created using the group. Please note that this API only creates the universal group and does not create a team. Microsoft Teams provides a user interface for teachers to create teams for their own classes using the groups created by this API.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationClass
{
OdataType = "#microsoft.graph.educationClass",
DisplayName = "String",
MailNickname = "String",
Description = "String",
CreatedBy = new IdentitySet
{
OdataType = "microsoft.graph.identitySet",
},
ClassCode = "String",
ExternalName = "String",
ExternalId = "String",
ExternalSource = EducationExternalSource.Sis,
ExternalSourceDetail = "String",
Grade = "String",
Term = new EducationTerm
{
OdataType = "microsoft.graph.educationTerm",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationClass educationClass = new EducationClass();
educationClass.setOdataType("#microsoft.graph.educationClass");
educationClass.setDisplayName("String");
educationClass.setMailNickname("String");
educationClass.setDescription("String");
IdentitySet createdBy = new IdentitySet();
createdBy.setOdataType("microsoft.graph.identitySet");
educationClass.setCreatedBy(createdBy);
educationClass.setClassCode("String");
educationClass.setExternalName("String");
educationClass.setExternalId("String");
educationClass.setExternalSource(EducationExternalSource.Sis);
educationClass.setExternalSourceDetail("String");
educationClass.setGrade("String");
EducationTerm term = new EducationTerm();
term.setOdataType("microsoft.graph.educationTerm");
educationClass.setTerm(term);
EducationClass result = graphClient.education().classes().post(educationClass);
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.