Namespace: microsoft.graph
Erstellen Sie ein neues educationSchool-Objekt .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
Nicht unterstützt |
Nicht unterstützt |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Anwendung |
EduRoster.ReadWrite.All |
Nicht verfügbar. |
HTTP-Anforderung
POST /education/schools
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des educationSchool-Objekts an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die beim Erstellen der educationSchool erforderlich sind.
| Eigenschaft |
Typ |
Beschreibung |
| displayName |
String |
Anzeigename der Schule Geerbt von educationOrganization. |
| description |
String |
Beschreibung der Schule Geerbt von educationOrganization. |
| externalSource |
educationExternalSource |
Quelle, aus der diese organization erstellt wurde. Geerbt von educationOrganization. Die möglichen Werte sind: sis, 'manuell. |
| externalSourceDetail |
Zeichenfolge |
Der Name der externen Quelle, aus der diese Ressourcen generiert wurden. |
| principalEmail |
String |
Die E-Mail-Adresse des Prinzipals |
| principalName |
String |
Der Name des Prinzipals |
| externalPrincipalId |
String |
Die ID des Prinzipals im Synchronisierungssystem |
| highestGrade |
String |
Höchste unterrichtete Klasse |
| lowestGrade |
String |
Niedrigste unterrichtete Klasse |
| schoolNumber |
String |
Schulnummer |
| externalId |
String |
Die ID der Schule im Synchronisierungssystem |
| phone |
String |
Die Telefonnummer der Schule |
| fax |
String |
Die Faxnummer der Schule |
| createdBy |
identitySet |
Entität, die Schule erstellt hat. |
| address |
physicalAddress |
Die Adresse der Schule |
Antwort
Wenn die Methode erfolgreich verläuft, werden der Antwortcode 201 Created und ein educationSchool-Objekt im Antworttext zurückgegeben.
Beispiele
Anforderung
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://v4.hkg1.meaqua.org/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Schools.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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://v4.hkg1.meaqua.org/en-us/graph/sdks/create-client?from=snippets&tabs=go
schools, err := graphClient.Education().Schools().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
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);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?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();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
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
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# 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://v4.hkg1.meaqua.org/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)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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"
}
}