POST https://graph.microsoft.com/v1.0/education/schools
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.educationSchool",
"displayName": "String",
"description": "String",
"externalSource": "String",
"externalSourceDetail": "String",
"principalEmail": "String",
"principalName": "String",
"externalPrincipalId": "String",
"lowestGrade": "String",
"highestGrade": "String",
"schoolNumber": "String",
"externalId": "String",
"phone": "String",
"fax": "String",
"createdBy": {
"@odata.type": "microsoft.graph.identitySet"
},
"address": {
"@odata.type": "microsoft.graph.physicalAddress"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationSchool
{
OdataType = "#microsoft.graph.educationSchool",
DisplayName = "String",
Description = "String",
ExternalSource = EducationExternalSource.Sis,
ExternalSourceDetail = "String",
PrincipalEmail = "String",
PrincipalName = "String",
ExternalPrincipalId = "String",
LowestGrade = "String",
HighestGrade = "String",
SchoolNumber = "String",
ExternalId = "String",
Phone = "String",
Fax = "String",
CreatedBy = new IdentitySet
{
OdataType = "microsoft.graph.identitySet",
},
Address = new PhysicalAddress
{
OdataType = "microsoft.graph.physicalAddress",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Schools.PostAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc education schools create --body '{\
"@odata.type": "#microsoft.graph.educationSchool",\
"displayName": "String",\
"description": "String",\
"externalSource": "String",\
"externalSourceDetail": "String",\
"principalEmail": "String",\
"principalName": "String",\
"externalPrincipalId": "String",\
"lowestGrade": "String",\
"highestGrade": "String",\
"schoolNumber": "String",\
"externalId": "String",\
"phone": "String",\
"fax": "String",\
"createdBy": {\
"@odata.type": "microsoft.graph.identitySet"\
},\
"address": {\
"@odata.type": "microsoft.graph.physicalAddress"\
}\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationSchool()
displayName := "String"
requestBody.SetDisplayName(&displayName)
description := "String"
requestBody.SetDescription(&description)
externalSource := graphmodels.STRING_EDUCATIONEXTERNALSOURCE
requestBody.SetExternalSource(&externalSource)
externalSourceDetail := "String"
requestBody.SetExternalSourceDetail(&externalSourceDetail)
principalEmail := "String"
requestBody.SetPrincipalEmail(&principalEmail)
principalName := "String"
requestBody.SetPrincipalName(&principalName)
externalPrincipalId := "String"
requestBody.SetExternalPrincipalId(&externalPrincipalId)
lowestGrade := "String"
requestBody.SetLowestGrade(&lowestGrade)
highestGrade := "String"
requestBody.SetHighestGrade(&highestGrade)
schoolNumber := "String"
requestBody.SetSchoolNumber(&schoolNumber)
externalId := "String"
requestBody.SetExternalId(&externalId)
phone := "String"
requestBody.SetPhone(&phone)
fax := "String"
requestBody.SetFax(&fax)
createdBy := graphmodels.NewIdentitySet()
requestBody.SetCreatedBy(createdBy)
address := graphmodels.NewPhysicalAddress()
requestBody.SetAddress(address)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
schools, err := graphClient.Education().Schools().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationSchool educationSchool = new EducationSchool();
educationSchool.setOdataType("#microsoft.graph.educationSchool");
educationSchool.setDisplayName("String");
educationSchool.setDescription("String");
educationSchool.setExternalSource(EducationExternalSource.Sis);
educationSchool.setExternalSourceDetail("String");
educationSchool.setPrincipalEmail("String");
educationSchool.setPrincipalName("String");
educationSchool.setExternalPrincipalId("String");
educationSchool.setLowestGrade("String");
educationSchool.setHighestGrade("String");
educationSchool.setSchoolNumber("String");
educationSchool.setExternalId("String");
educationSchool.setPhone("String");
educationSchool.setFax("String");
IdentitySet createdBy = new IdentitySet();
createdBy.setOdataType("microsoft.graph.identitySet");
educationSchool.setCreatedBy(createdBy);
PhysicalAddress address = new PhysicalAddress();
address.setOdataType("microsoft.graph.physicalAddress");
educationSchool.setAddress(address);
EducationSchool result = graphClient.education().schools().post(educationSchool);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const educationSchool = {
'@odata.type': '#microsoft.graph.educationSchool',
displayName: 'String',
description: 'String',
externalSource: 'String',
externalSourceDetail: 'String',
principalEmail: 'String',
principalName: 'String',
externalPrincipalId: 'String',
lowestGrade: 'String',
highestGrade: 'String',
schoolNumber: 'String',
externalId: 'String',
phone: 'String',
fax: 'String',
createdBy: {
'@odata.type': 'microsoft.graph.identitySet'
},
address: {
'@odata.type': 'microsoft.graph.physicalAddress'
}
};
await client.api('/education/schools')
.post(educationSchool);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationSchool;
use Microsoft\Graph\Generated\Models\EducationExternalSource;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\PhysicalAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationSchool();
$requestBody->setOdataType('#microsoft.graph.educationSchool');
$requestBody->setDisplayName('String');
$requestBody->setDescription('String');
$requestBody->setExternalSource(new EducationExternalSource('string'));
$requestBody->setExternalSourceDetail('String');
$requestBody->setPrincipalEmail('String');
$requestBody->setPrincipalName('String');
$requestBody->setExternalPrincipalId('String');
$requestBody->setLowestGrade('String');
$requestBody->setHighestGrade('String');
$requestBody->setSchoolNumber('String');
$requestBody->setExternalId('String');
$requestBody->setPhone('String');
$requestBody->setFax('String');
$createdBy = new IdentitySet();
$createdBy->setOdataType('microsoft.graph.identitySet');
$requestBody->setCreatedBy($createdBy);
$address = new PhysicalAddress();
$address->setOdataType('microsoft.graph.physicalAddress');
$requestBody->setAddress($address);
$result = $graphServiceClient->education()->schools()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Education
$params = @{
"@odata.type" = "#microsoft.graph.educationSchool"
displayName = "String"
description = "String"
externalSource = "String"
externalSourceDetail = "String"
principalEmail = "String"
principalName = "String"
externalPrincipalId = "String"
lowestGrade = "String"
highestGrade = "String"
schoolNumber = "String"
externalId = "String"
phone = "String"
fax = "String"
createdBy = @{
"@odata.type" = "microsoft.graph.identitySet"
}
address = @{
"@odata.type" = "microsoft.graph.physicalAddress"
}
}
New-MgEducationSchool -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.education_school import EducationSchool
from msgraph.generated.models.education_external_source import EducationExternalSource
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.physical_address import PhysicalAddress
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EducationSchool(
odata_type = "#microsoft.graph.educationSchool",
display_name = "String",
description = "String",
external_source = EducationExternalSource.Sis,
external_source_detail = "String",
principal_email = "String",
principal_name = "String",
external_principal_id = "String",
lowest_grade = "String",
highest_grade = "String",
school_number = "String",
external_id = "String",
phone = "String",
fax = "String",
created_by = IdentitySet(
odata_type = "microsoft.graph.identitySet",
),
address = PhysicalAddress(
odata_type = "microsoft.graph.physicalAddress",
),
)
result = await graph_client.education.schools.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。