Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
POST https://graph.microsoft.com/beta/education/schools
Content-type: application/json
{
"displayName": "Fabrikam High School",
"description": "Magnate school for the arts. Los Angeles School District",
"externalSource": "String",
"principalEmail": "AmyR@fabrikam.com",
"principalName": "Amy Roebuck",
"externalPrincipalId": "14007",
"highestGrade": "12",
"lowestGrade": "9",
"schoolNumber": "10002",
"address": {
"city": "Los Angeles",
"countryOrRegion": "United States",
"postalCode": "98055",
"state": "CA",
"street": "12345 Main St."
},
"externalId": "10002",
"phone": "+1 (253) 555-0102",
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new EducationSchool
{
DisplayName = "Fabrikam High School",
Description = "Magnate school for the arts. Los Angeles School District",
ExternalSource = EducationExternalSource.Sis,
PrincipalEmail = "AmyR@fabrikam.com",
PrincipalName = "Amy Roebuck",
ExternalPrincipalId = "14007",
HighestGrade = "12",
LowestGrade = "9",
SchoolNumber = "10002",
Address = new PhysicalAddress
{
City = "Los Angeles",
CountryOrRegion = "United States",
PostalCode = "98055",
State = "CA",
Street = "12345 Main St.",
},
ExternalId = "10002",
Phone = "+1 (253) 555-0102",
};
// 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);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationSchool educationSchool = new EducationSchool();
educationSchool.setDisplayName("Fabrikam High School");
educationSchool.setDescription("Magnate school for the arts. Los Angeles School District");
educationSchool.setExternalSource(EducationExternalSource.Sis);
educationSchool.setPrincipalEmail("AmyR@fabrikam.com");
educationSchool.setPrincipalName("Amy Roebuck");
educationSchool.setExternalPrincipalId("14007");
educationSchool.setHighestGrade("12");
educationSchool.setLowestGrade("9");
educationSchool.setSchoolNumber("10002");
PhysicalAddress address = new PhysicalAddress();
address.setCity("Los Angeles");
address.setCountryOrRegion("United States");
address.setPostalCode("98055");
address.setState("CA");
address.setStreet("12345 Main St.");
educationSchool.setAddress(address);
educationSchool.setExternalId("10002");
educationSchool.setPhone("+1 (253) 555-0102");
EducationSchool result = graphClient.education().schools().post(educationSchool);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\EducationSchool;
use Microsoft\Graph\Beta\Generated\Models\EducationExternalSource;
use Microsoft\Graph\Beta\Generated\Models\PhysicalAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationSchool();
$requestBody->setDisplayName('Fabrikam High School');
$requestBody->setDescription('Magnate school for the arts. Los Angeles School District');
$requestBody->setExternalSource(new EducationExternalSource('string'));
$requestBody->setPrincipalEmail('AmyR@fabrikam.com');
$requestBody->setPrincipalName('Amy Roebuck');
$requestBody->setExternalPrincipalId('14007');
$requestBody->setHighestGrade('12');
$requestBody->setLowestGrade('9');
$requestBody->setSchoolNumber('10002');
$address = new PhysicalAddress();
$address->setCity('Los Angeles');
$address->setCountryOrRegion('United States');
$address->setPostalCode('98055');
$address->setState('CA');
$address->setStreet('12345 Main St.');
$requestBody->setAddress($address);
$requestBody->setExternalId('10002');
$requestBody->setPhone('+1 (253) 555-0102');
$result = $graphServiceClient->education()->schools()->post($requestBody)->wait();
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez https://aka.ms/ContentUserFeedback.