educationSchool を作成する
-
[アーティクル]
-
-
名前空間: microsoft.graph
新しい educationSchool オブジェクトを作成 します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
サポートされていません。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
EduRoster.ReadWrite.All |
HTTP 要求
POST /education/schools
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-Type |
application/json. Required. |
要求本文
要求本文で 、educationSchool オブジェクトの JSON 表記を指定します。
次の表に、educationSchool を作成するときに必要な プロパティを示します。
| プロパティ |
型 |
説明 |
| displayName |
String |
学校の表示名。 教育から継承 Organization. |
| description |
String |
学校の説明。 教育から継承 Organization. |
| externalSource |
educationExternalSource |
この組織が作成されたソース。 教育から継承 Organization. 指定できる値は sis 、'manual です。 |
| externalSourceDetail |
String |
このリソースが生成された外部ソースの名前。 |
| principalEmail |
String |
プリンシパルの電子メール アドレス。 |
| principalName |
String |
プリンシパルの名前。 |
| externalPrincipalId |
String |
同期システム内のプリンシパルの ID。 |
| highestGrade |
String |
授業を受けている最高学年。 |
| lowestGrade |
String |
授業を受けている最低学年。 |
| schoolNumber |
String |
学校番号。 |
| externalId |
String |
同期システム内の学校の ID。 |
| phone |
String |
学校の電話番号。 |
| fax |
String |
学校の FAX 番号。 |
| createdBy |
identitySet |
学校を作成したエンティティ。 |
| address |
physicalAddress |
学校の住所。 |
応答
成功した場合、このメソッドは 201 Created 応答コードと、応答本文で educationSchool オブジェクトを返します。
例
要求
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"
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var educationSchool = new 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
{
},
Address = new PhysicalAddress
{
}
};
await graphClient.Education.Schools
.Request()
.AddAsync(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 のドキュメントを参照してください。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/education/schools"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphEducationSchool *educationSchool = [[MSGraphEducationSchool alloc] init];
[educationSchool setDisplayName:@"String"];
[educationSchool setDescription:@"String"];
[educationSchool setExternalSource: [MSGraphEducationExternalSource 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"];
MSGraphIdentitySet *createdBy = [[MSGraphIdentitySet alloc] init];
[educationSchool setCreatedBy:createdBy];
MSGraphPhysicalAddress *address = [[MSGraphPhysicalAddress alloc] init];
[educationSchool setAddress:address];
NSError *error;
NSData *educationSchoolData = [educationSchool getSerializedDataWithError:&error];
[urlRequest setHTTPBody:educationSchoolData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
EducationSchool educationSchool = new EducationSchool();
educationSchool.displayName = "String";
educationSchool.description = "String";
educationSchool.externalSource = EducationExternalSource.SIS;
educationSchool.externalSourceDetail = "String";
educationSchool.principalEmail = "String";
educationSchool.principalName = "String";
educationSchool.externalPrincipalId = "String";
educationSchool.lowestGrade = "String";
educationSchool.highestGrade = "String";
educationSchool.schoolNumber = "String";
educationSchool.externalId = "String";
educationSchool.phone = "String";
educationSchool.fax = "String";
IdentitySet createdBy = new IdentitySet();
educationSchool.createdBy = createdBy;
PhysicalAddress address = new PhysicalAddress();
educationSchool.address = address;
graphClient.education().schools()
.buildRequest()
.post(educationSchool);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEducationSchool()
displayName := "String"
requestBody.SetDisplayName(&displayName)
description := "String"
requestBody.SetDescription(&description)
externalSource := "String"
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 := msgraphsdk.NewIdentitySet()
requestBody.SetCreatedBy(createdBy)
createdBy.SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.identitySet",
}
address := msgraphsdk.NewPhysicalAddress()
requestBody.SetAddress(address)
address.SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.physicalAddress",
}
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.educationSchool",
}
result, err := graphClient.Education().Schools().Post(requestBody)
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 のドキュメントを参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.educationSchool",
"id": "1c23c12e-c12e-1c23-2ec1-231c2ec1231c",
"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"
}
}