Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren Sie die Eigenschaften eines Place-Objekts , bei dem es sich um ein Gebäude, eine Etage, einen Abschnitt, einen Schreibtisch, einen Raum, einen Arbeitsbereich oder eine roomList handeln kann. Sie können den Ort identifizieren, indem Sie die Id-Eigenschaft angeben.
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) |
Place.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Nicht unterstützt |
Nicht unterstützt |
Hinweis: Exchange Admin Rolle ist zum Aktualisieren von Orten erforderlich.
HTTP-Anforderung
PATCH /places/{id}
Anmerkung:{id} ist der eindeutige Bezeichner des zu aktualisierenden Orts .
Anforderungstext
Geben Sie im Anforderungstext nur die Werte für zu aktualisierende Eigenschaften an. Vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, behalten ihre vorherigen Werte bei oder werden basierend auf Änderungen an anderen Eigenschaftswerten neu berechnet.
In der folgenden Tabelle sind die Eigenschaften angegeben, die aktualisiert werden können.
Es kann jeweils nur eine instance einer Ortsressource aktualisiert werden. Verwenden Sie im Anforderungstext @odata.type , um den Typ des Orts anzugeben und die zu aktualisierenden Eigenschaften einzuschließen.
Hinweis
Sie können diese API nicht verwenden, um id, placeId, emailAddress, displayName oder bookingType eines place-Objekts zu aktualisieren.
| Eigenschaft |
Typ |
Beschreibung |
| address |
physicalAddress |
Die physische Adresse des Ortes, einschließlich Straße, Stadt, Bundesland, Land oder Region und Postleitzahl. Optional. |
| geoCoordinates |
outlookGeoCoordinates |
Gibt die Ortsposition in Breiten-, Längen- und (optional) Höhenkoordinaten an. Optional. |
| isWheelChairAccessible |
Boolean |
Gibt an, ob der Ort für Rollstuhlfahrer zugänglich ist. Erforderlich. |
| label |
Zeichenfolge |
Benutzerdefinierte Beschreibung des Ortes. Optional. |
| parentId |
Zeichenfolge |
ID eines übergeordneten Orts. Optional. |
| phone |
Zeichenfolge |
Die Telefonnummer des Orts. Optional. |
| tags |
Zeichenfolgenauflistung |
Benutzerdefinierte Tags, die dem Ort für die Kategorisierung oder Filterung zugeordnet sind. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode einen 200 OK Antwortcode und ein aktualisiertes Place-Objekt im Antworttext zurück.
Beispiele
Beispiel 1: Aktualisieren eines Gebäudes
Das folgende Beispiel zeigt, wie ein Gebäudeobjekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/e18a8e21-0494-4296-a5bc-f848dba2740d
Content-Type: application/json
{
"@odata.type": "microsoft.graph.building",
"tags": ["most popular building"]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Building
{
OdataType = "microsoft.graph.building",
Tags = new List<string>
{
"most popular building",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
tags := []string {
"most popular building",
}
requestBody.SetTags(tags)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Building place = new Building();
place.setOdataType("microsoft.graph.building");
LinkedList<String> tags = new LinkedList<String>();
tags.add("most popular building");
place.setTags(tags);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.building',
tags: ['most popular building']
};
await client.api('/places/e18a8e21-0494-4296-a5bc-f848dba2740d')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Building;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Building();
$requestBody->setOdataType('microsoft.graph.building');
$requestBody->setTags(['most popular building', ]);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.building"
tags = @(
"most popular building"
)
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.building import Building
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Building(
odata_type = "microsoft.graph.building",
tags = [
"most popular building",
],
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.building",
"id": "e18a8e21-0494-4296-a5bc-f848dba2740d",
"placeId": "e18a8e21-0494-4296-a5bc-f848dba2740d",
"displayName": "MRS",
"phone": "8801733457",
"tags": [
"most popular building"
],
"isWheelChairAccessible": true,
"label": "this is a building not open to all",
"hasWiFi": false,
"geoCoordinates": {
"latitude": 31.2513263,
"longitude": 121.3912291,
"accuracy": null,
"altitude": null,
"altitudeAccuracy": null
},
"resourceLinks": []
}
Beispiel 2: Aktualisieren einer Etage
Das folgende Beispiel zeigt, wie ein Floor-Objekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/c64205d0-1a2d-4cfe-9012-3f5d668d28ea
Content-Type: application/json
{
"@odata.type": "microsoft.graph.floor",
"isWheelChairAccessible": true,
"sortOrder": 2
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Floor
{
OdataType = "microsoft.graph.floor",
IsWheelChairAccessible = true,
SortOrder = 2,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
isWheelChairAccessible := true
requestBody.SetIsWheelChairAccessible(&isWheelChairAccessible)
sortOrder := int32(2)
requestBody.SetSortOrder(&sortOrder)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Floor place = new Floor();
place.setOdataType("microsoft.graph.floor");
place.setIsWheelChairAccessible(true);
place.setSortOrder(2);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.floor',
isWheelChairAccessible: true,
sortOrder: 2
};
await client.api('/places/c64205d0-1a2d-4cfe-9012-3f5d668d28ea')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Floor;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Floor();
$requestBody->setOdataType('microsoft.graph.floor');
$requestBody->setIsWheelChairAccessible(true);
$requestBody->setSortOrder(2);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.floor"
isWheelChairAccessible = $true
sortOrder =
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.floor import Floor
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Floor(
odata_type = "microsoft.graph.floor",
is_wheel_chair_accessible = True,
sort_order = 2,
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.floor",
"id": "c64205d0-1a2d-4cfe-9012-3f5d668d28ea",
"placeId": "c64205d0-1a2d-4cfe-9012-3f5d668d28ea",
"displayName": "Floor X",
"parentId": "be7b53f1-7c63-4533-91d4-52c3ca856afb",
"isWheelChairAccessible": true,
"sortOrder": 2,
"geoCoordinates": {
"latitude": 0.0,
"longitude": 0.0,
"accuracy": null,
"altitude": null,
"altitudeAccuracy": null
}
}
Beispiel 3: Aktualisieren eines Abschnitts
Das folgende Beispiel zeigt, wie ein Abschnittsobjekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/3e7160bb-75da-4456-ab3c-5ee061f4611a
Content-Type: application/json
{
"@odata.type": "microsoft.graph.section",
"label": "discuss area"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Section
{
OdataType = "microsoft.graph.section",
Label = "discuss area",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
label := "discuss area"
requestBody.SetLabel(&label)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Section place = new Section();
place.setOdataType("microsoft.graph.section");
place.setLabel("discuss area");
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.section',
label: 'discuss area'
};
await client.api('/places/3e7160bb-75da-4456-ab3c-5ee061f4611a')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Section;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Section();
$requestBody->setOdataType('microsoft.graph.section');
$requestBody->setLabel('discuss area');
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.section"
label = "discuss area"
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.section import Section
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Section(
odata_type = "microsoft.graph.section",
label = "discuss area",
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.section",
"id": "3e7160bb-75da-4456-ab3c-5ee061f4611a",
"placeId": "3e7160bb-75da-4456-ab3c-5ee061f4611a",
"displayName": "section_1",
"parentId": "e30d4c71-95bf-4576-be4f-b6b7a8d2eeb7",
"isWheelChairAccessible": false,
"label": "discuss area"
}
Beispiel 4: Aktualisieren eines Schreibtischs
Im folgenden Beispiel wird gezeigt, wie ein Desk-Objekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/530f7900-8063-4daf-9cc1-168cb3ac26e9
Content-Type: application/json
{
"@odata.type": "microsoft.graph.desk",
"mode": {
"@odata.type": "microsoft.graph.dropInPlaceMode"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Desk
{
OdataType = "microsoft.graph.desk",
Mode = new DropInPlaceMode
{
OdataType = "microsoft.graph.dropInPlaceMode",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
mode := graphmodels.NewDropInPlaceMode()
requestBody.SetMode(mode)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Desk place = new Desk();
place.setOdataType("microsoft.graph.desk");
DropInPlaceMode mode = new DropInPlaceMode();
mode.setOdataType("microsoft.graph.dropInPlaceMode");
place.setMode(mode);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.desk',
mode: {
'@odata.type': 'microsoft.graph.dropInPlaceMode'
}
};
await client.api('/places/530f7900-8063-4daf-9cc1-168cb3ac26e9')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Desk;
use Microsoft\Graph\Beta\Generated\Models\DropInPlaceMode;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Desk();
$requestBody->setOdataType('microsoft.graph.desk');
$mode = new DropInPlaceMode();
$mode->setOdataType('microsoft.graph.dropInPlaceMode');
$requestBody->setMode($mode);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.desk"
mode = @{
"@odata.type" = "microsoft.graph.dropInPlaceMode"
}
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.desk import Desk
from msgraph_beta.generated.models.drop_in_place_mode import DropInPlaceMode
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Desk(
odata_type = "microsoft.graph.desk",
mode = DropInPlaceMode(
odata_type = "microsoft.graph.dropInPlaceMode",
),
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.desk",
"id": "530f7900-8063-4daf-9cc1-168cb3ac26e9",
"placeId": "530f7900-8063-4daf-9cc1-168cb3ac26e9",
"displayName": "desk 5",
"parentId": "ca163ae1-14a3-4e2a-8a97-5f82d672186f",
"isWheelChairAccessible": true,
"mailboxDetails": {
"externalDirectoryObjectId": "04c6ff74-9268-41aa-96b5-5637d9f039bf",
"emailAddress": "desk5ca86f9b61753443541750@contoso.com"
},
"mode": {
"@odata.type": "#microsoft.graph.dropInPlaceMode"
}
}
Beispiel 5: Aktualisieren eines Raums
Das folgende Beispiel zeigt, wie ein Raumobjekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/cf100@contoso.com
Content-Type: application/json
{
"@odata.type": "microsoft.graph.room",
"nickname": "Conf Room",
"building": "1",
"label": "100",
"capacity": 50,
"isWheelChairAccessible": false
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Room
{
OdataType = "microsoft.graph.room",
Nickname = "Conf Room",
Building = "1",
Label = "100",
Capacity = 50,
IsWheelChairAccessible = false,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
nickname := "Conf Room"
requestBody.SetNickname(&nickname)
building := "1"
requestBody.SetBuilding(&building)
label := "100"
requestBody.SetLabel(&label)
capacity := int32(50)
requestBody.SetCapacity(&capacity)
isWheelChairAccessible := false
requestBody.SetIsWheelChairAccessible(&isWheelChairAccessible)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Room place = new Room();
place.setOdataType("microsoft.graph.room");
place.setNickname("Conf Room");
place.setBuilding("1");
place.setLabel("100");
place.setCapacity(50);
place.setIsWheelChairAccessible(false);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.room',
nickname: 'Conf Room',
building: '1',
label: '100',
capacity: 50,
isWheelChairAccessible: false
};
await client.api('/places/cf100@contoso.com')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Room;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Room();
$requestBody->setOdataType('microsoft.graph.room');
$requestBody->setNickname('Conf Room');
$requestBody->setBuilding('1');
$requestBody->setLabel('100');
$requestBody->setCapacity(50);
$requestBody->setIsWheelChairAccessible(false);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.room"
nickname = "Conf Room"
building = "1"
label = "100"
capacity =
isWheelChairAccessible = $false
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.room import Room
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Room(
odata_type = "microsoft.graph.room",
nickname = "Conf Room",
building = "1",
label = "100",
capacity = 50,
is_wheel_chair_accessible = False,
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#places/$entity",
"@odata.type": "#microsoft.graph.room",
"id": "3162F1E1-C4C0-604B-51D8-91DA78989EB1",
"emailAddress": "cf100@contoso.com",
"displayName": "Conf Room 100",
"address": {
"street": "4567 Main Street",
"city": "Buffalo",
"state": "NY",
"postalCode": "98052",
"countryOrRegion": "USA"
},
"geoCoordinates": {
"latitude": 47.0,
"longitude": -122.0
},
"phone": "555-555-0100",
"nickname": "Conf Room",
"label": "100",
"capacity": 50,
"building": "1",
"floorLabel": "1P",
"floorNumber": 1,
"isWheelChairAccessible": false,
"bookingType": "standard",
"tags": [
"bean bags"
],
"audioDeviceName": null,
"videoDeviceName": null,
"displayDeviceName": "surface hub",
"placeId": "080ed1a0-7b54-4995-85a5-eeec751786f5"
}
Beispiel 6: Aktualisieren eines Arbeitsbereichs
Das folgende Beispiel zeigt, wie ein Arbeitsbereichsobjekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/ws100@contoso.com
Content-Type: application/json
{
"@odata.type": "microsoft.graph.workspace",
"nickname": "Conf Room",
"building": "1",
"label": "100",
"capacity": 50,
"isWheelChairAccessible": false
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Workspace
{
OdataType = "microsoft.graph.workspace",
Nickname = "Conf Room",
Building = "1",
Label = "100",
Capacity = 50,
IsWheelChairAccessible = false,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
nickname := "Conf Room"
requestBody.SetNickname(&nickname)
building := "1"
requestBody.SetBuilding(&building)
label := "100"
requestBody.SetLabel(&label)
capacity := int32(50)
requestBody.SetCapacity(&capacity)
isWheelChairAccessible := false
requestBody.SetIsWheelChairAccessible(&isWheelChairAccessible)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Workspace place = new Workspace();
place.setOdataType("microsoft.graph.workspace");
place.setNickname("Conf Room");
place.setBuilding("1");
place.setLabel("100");
place.setCapacity(50);
place.setIsWheelChairAccessible(false);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.workspace',
nickname: 'Conf Room',
building: '1',
label: '100',
capacity: 50,
isWheelChairAccessible: false
};
await client.api('/places/ws100@contoso.com')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Workspace;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Workspace();
$requestBody->setOdataType('microsoft.graph.workspace');
$requestBody->setNickname('Conf Room');
$requestBody->setBuilding('1');
$requestBody->setLabel('100');
$requestBody->setCapacity(50);
$requestBody->setIsWheelChairAccessible(false);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Calendar
$params = @{
"@odata.type" = "microsoft.graph.workspace"
nickname = "Conf Room"
building = "1"
label = "100"
capacity =
isWheelChairAccessible = $false
}
Update-MgBetaPlace -PlaceId $placeId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.workspace import Workspace
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Workspace(
odata_type = "microsoft.graph.workspace",
nickname = "Conf Room",
building = "1",
label = "100",
capacity = 50,
is_wheel_chair_accessible = False,
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#places/$entity",
"@odata.type": "#microsoft.graph.workspace",
"id": "3162F1E1-C4C0-604B-51D8-91DA78989EB1",
"emailAddress": "ws100@contoso.com",
"displayName": "Workspace 100",
"address": {
"street": "4567 Main Street",
"city": "Buffalo",
"state": "NY",
"postalCode": "98052",
"countryOrRegion": "USA"
},
"geoCoordinates": {
"latitude": 47.0,
"longitude": -122.0
},
"phone": "555-555-0100",
"nickname": "Workspace",
"label": "100",
"capacity": 50,
"building": "1",
"floorLabel": "1P",
"floorNumber": 1,
"isWheelChairAccessible": false,
"tags": [
"bean bags"
],
"placeId": "357e8ddc-8af5-4c7c-bc38-ddb3bcfec0d9"
}
Beispiel 7: Aktualisieren einer Raumliste
Das folgende Beispiel zeigt, wie ein roomList-Objekt aktualisiert wird.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/places/Building1RroomList@contoso.com
Content-Type: application/json
{
"@odata.type": "microsoft.graph.roomList",
"displayName": "Building 1",
"phone": "555-555-0100",
"address": {
"street": "4567 Main Street",
"city": "Buffalo",
"state": "NY",
"postalCode": "98052",
"countryOrRegion": "USA"
},
"geoCoordinates": {
"altitude": null,
"latitude": 47.0,
"longitude": -122.0,
"accuracy": null,
"altitudeAccuracy": null
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new RoomList
{
OdataType = "microsoft.graph.roomList",
DisplayName = "Building 1",
Phone = "555-555-0100",
Address = new PhysicalAddress
{
Street = "4567 Main Street",
City = "Buffalo",
State = "NY",
PostalCode = "98052",
CountryOrRegion = "USA",
},
GeoCoordinates = new OutlookGeoCoordinates
{
Altitude = null,
Latitude = 47d,
Longitude = -122d,
Accuracy = null,
AltitudeAccuracy = null,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Places["{place-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPlace()
displayName := "Building 1"
requestBody.SetDisplayName(&displayName)
phone := "555-555-0100"
requestBody.SetPhone(&phone)
address := graphmodels.NewPhysicalAddress()
street := "4567 Main Street"
address.SetStreet(&street)
city := "Buffalo"
address.SetCity(&city)
state := "NY"
address.SetState(&state)
postalCode := "98052"
address.SetPostalCode(&postalCode)
countryOrRegion := "USA"
address.SetCountryOrRegion(&countryOrRegion)
requestBody.SetAddress(address)
geoCoordinates := graphmodels.NewOutlookGeoCoordinates()
altitude := null
geoCoordinates.SetAltitude(&altitude)
latitude := float64(47)
geoCoordinates.SetLatitude(&latitude)
longitude := float64(-122)
geoCoordinates.SetLongitude(&longitude)
accuracy := null
geoCoordinates.SetAccuracy(&accuracy)
altitudeAccuracy := null
geoCoordinates.SetAltitudeAccuracy(&altitudeAccuracy)
requestBody.SetGeoCoordinates(geoCoordinates)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
places, err := graphClient.Places().ByPlaceId("place-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
RoomList place = new RoomList();
place.setOdataType("microsoft.graph.roomList");
place.setDisplayName("Building 1");
place.setPhone("555-555-0100");
PhysicalAddress address = new PhysicalAddress();
address.setStreet("4567 Main Street");
address.setCity("Buffalo");
address.setState("NY");
address.setPostalCode("98052");
address.setCountryOrRegion("USA");
place.setAddress(address);
OutlookGeoCoordinates geoCoordinates = new OutlookGeoCoordinates();
geoCoordinates.setAltitude(null);
geoCoordinates.setLatitude(47d);
geoCoordinates.setLongitude(-122d);
geoCoordinates.setAccuracy(null);
geoCoordinates.setAltitudeAccuracy(null);
place.setGeoCoordinates(geoCoordinates);
Place result = graphClient.places().byPlaceId("{place-id}").patch(place);
const options = {
authProvider,
};
const client = Client.init(options);
const place = {
'@odata.type': 'microsoft.graph.roomList',
displayName: 'Building 1',
phone: '555-555-0100',
address: {
street: '4567 Main Street',
city: 'Buffalo',
state: 'NY',
postalCode: '98052',
countryOrRegion: 'USA'
},
geoCoordinates: {
altitude: null,
latitude: 47.0,
longitude: -122.0,
accuracy: null,
altitudeAccuracy: null
}
};
await client.api('/places/Building1RroomList@contoso.com')
.version('beta')
.update(place);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\RoomList;
use Microsoft\Graph\Beta\Generated\Models\PhysicalAddress;
use Microsoft\Graph\Beta\Generated\Models\OutlookGeoCoordinates;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RoomList();
$requestBody->setOdataType('microsoft.graph.roomList');
$requestBody->setDisplayName('Building 1');
$requestBody->setPhone('555-555-0100');
$address = new PhysicalAddress();
$address->setStreet('4567 Main Street');
$address->setCity('Buffalo');
$address->setState('NY');
$address->setPostalCode('98052');
$address->setCountryOrRegion('USA');
$requestBody->setAddress($address);
$geoCoordinates = new OutlookGeoCoordinates();
$geoCoordinates->setAltitude(null);
$geoCoordinates->setLatitude(47);
$geoCoordinates->setLongitude(-122);
$geoCoordinates->setAccuracy(null);
$geoCoordinates->setAltitudeAccuracy(null);
$requestBody->setGeoCoordinates($geoCoordinates);
$result = $graphServiceClient->places()->byPlaceId('place-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.room_list import RoomList
from msgraph_beta.generated.models.physical_address import PhysicalAddress
from msgraph_beta.generated.models.outlook_geo_coordinates import OutlookGeoCoordinates
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RoomList(
odata_type = "microsoft.graph.roomList",
display_name = "Building 1",
phone = "555-555-0100",
address = PhysicalAddress(
street = "4567 Main Street",
city = "Buffalo",
state = "NY",
postal_code = "98052",
country_or_region = "USA",
),
geo_coordinates = OutlookGeoCoordinates(
altitude = None,
latitude = 47,
longitude = -122,
accuracy = None,
altitude_accuracy = None,
),
)
result = await graph_client.places.by_place_id('place-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#places/$entity",
"@odata.type": "#microsoft.graph.roomList",
"id": "DC404124-302A-92AA-F98D-7B4DEB0C1705",
"displayName": "Building 1",
"address": {
"street": "4567 Main Street",
"city": "Buffalo",
"state": "NY",
"postalCode": "98052",
"countryOrRegion": "USA"
},
"geoCoordinates": {
"altitude": null,
"latitude": 47.0,
"longitude": -122.0,
"accuracy": null,
"altitudeAccuracy": null
},
"phone": "555-555-0100",
"emailAddress": "bldg1@contoso.com",
"placeId": "406bd1b2-237c-4710-bda2-8b7900d61b27"
}