Update place
Article
05/12/2022
7 minutes to read
12 contributors
In this article
Namespace: microsoft.graph
Update the properties of place object, which can be a room or roomList . You can identify the room or roomList by specifying the id or emailAddress property.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Place.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Not supported
HTTP request
PATCH /places/{id | emailAddress}
Name
Value
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, supply the values for relevant fields that should be updated. Only one instance of a place resource (room or roomList ) can be updated at a time. In the request body, use @odata.type
to specify the type of place, and include the properties of that type to update. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Property
Type
Description
address
physicalAddress
The street address of the room or roomlist.
audioDeviceName
String
Specifies the name of the audio device in the room.
bookingType
bookingType
Type of room. Possible values are Standard
and Reserved
.
building
String
Specifies the building name or building number that the room is in.
capacity
Int32
Specifies the capacity of the room.
displayDeviceName
String
Specifies the name of the display device in the room.
floorLabel
String
Specifies the floor letter that the room is on.
floorNumber
Int32
Specifies the floor number that the room is on.
geoCoordinates
outlookGeoCoordinates
Specifies the room or roomlist location in latitude, longitude and optionally, altitude coordinates.
isWheelChairAccessible
Boolean
Specifies whether the room is wheelchair accessible.
label
String
Specifies a descriptive label for the room, for example, a number or name.
nickname
String
Specifies a nickname for the room, for example, "conf room".
phone
String
The phone number of the room or roomlist.
tags
String collection
Specifies additional features of the room, for example, details like the type of view or furniture type.
videoDeviceName
String
Specifies the name of the video device in the room.
Response
If successful, this method returns a 200 OK
response code and an updated place object in the response body.
Examples
Example 1: Update a room
Request
The following is an example of the request.
PATCH https://graph.microsoft.com/v1.0/places/cf100@contoso.com
Content-type: application/json
{
"@odata.type": "microsoft.graph.room",
"nickname": "Conf Room",
"building": "1",
"label": "100",
"capacity": 50,
"isWheelChairAccessible": false
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var place = new Room
{
Nickname = "Conf Room",
Building = "1",
Label = "100",
Capacity = 50,
IsWheelChairAccessible = false
};
await graphClient.Places["{place-id}"]
.Request()
.UpdateAsync(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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')
.update(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/places/cf100@contoso.com"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphPlace *place = [[MSGraphPlace alloc] init];
[place setNickname:@"Conf Room"];
[place setBuilding:@"1"];
[place setLabel:@"100"];
[place setCapacity: 50];
[place setIsWheelChairAccessible: false];
NSError *error;
NSData *placeData = [place getSerializedDataWithError:&error];
[urlRequest setHTTPBody:placeData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Room place = new Room();
place.nickname = "Conf Room";
place.building = "1";
place.label = "100";
place.capacity = 50;
place.isWheelChairAccessible = false;
graphClient.places("cf100@contoso.com")
.buildRequest()
.patch(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewPlace()
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.room",
"nickname": "Conf Room",
"building": "1",
"label": "100",
"capacity": ,
"isWheelChairAccessible": false,
}
placeId := "place-id"
graphClient.PlacesById(&placeId).Patch(requestBody)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Calendar
$params = @{
"@odata.type" = "microsoft.graph.room"
Nickname = "Conf Room"
Building = "1"
Label = "100"
Capacity =
IsWheelChairAccessible = $false
}
Update-MgPlace -PlaceId $placeId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following is an example of the response.
Note
The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$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,
"isManaged": true,
"isWheelChairAccessible": false,
"bookingType": "standard",
"tags": [
"bean bags"
],
"audioDeviceName": null,
"videoDeviceName": null,
"displayDevice": "surface hub"
}
Example 2: Update a roomlist
Request
The following is an example of the request.
PATCH https://graph.microsoft.com/v1.0/places/Building1RroomList@contoso.onmicrosoft.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
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var place = new 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 = 47,
Longitude = -122,
Accuracy = null,
AltitudeAccuracy = null
}
};
await graphClient.Places["{place-id}"]
.Request()
.UpdateAsync(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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.onmicrosoft.com')
.update(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/places/Building1RroomList@contoso.onmicrosoft.com"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphPlace *place = [[MSGraphPlace alloc] init];
[place setDisplayName:@"Building 1"];
[place setPhone:@"555-555-0100"];
MSGraphPhysicalAddress *address = [[MSGraphPhysicalAddress alloc] init];
[address setStreet:@"4567 Main Street"];
[address setCity:@"Buffalo"];
[address setState:@"NY"];
[address setPostalCode:@"98052"];
[address setCountryOrRegion:@"USA"];
[place setAddress:address];
MSGraphOutlookGeoCoordinates *geoCoordinates = [[MSGraphOutlookGeoCoordinates alloc] init];
[geoCoordinates setAltitude: null];
[geoCoordinates setLatitude: 47.0];
[geoCoordinates setLongitude: -122.0];
[geoCoordinates setAccuracy: null];
[geoCoordinates setAltitudeAccuracy: null];
[place setGeoCoordinates:geoCoordinates];
NSError *error;
NSData *placeData = [place getSerializedDataWithError:&error];
[urlRequest setHTTPBody:placeData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
RoomList place = new RoomList();
place.displayName = "Building 1";
place.phone = "555-555-0100";
PhysicalAddress address = new PhysicalAddress();
address.street = "4567 Main Street";
address.city = "Buffalo";
address.state = "NY";
address.postalCode = "98052";
address.countryOrRegion = "USA";
place.address = address;
OutlookGeoCoordinates geoCoordinates = new OutlookGeoCoordinates();
geoCoordinates.altitude = 0d;
geoCoordinates.latitude = 47.0d;
geoCoordinates.longitude = -122.0d;
geoCoordinates.accuracy = 0d;
geoCoordinates.altitudeAccuracy = 0d;
place.geoCoordinates = geoCoordinates;
graphClient.places("Building1RroomList@contoso.onmicrosoft.com")
.buildRequest()
.patch(place);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewPlace()
displayName := "Building 1"
requestBody.SetDisplayName(&displayName)
phone := "555-555-0100"
requestBody.SetPhone(&phone)
address := msgraphsdk.NewPhysicalAddress()
requestBody.SetAddress(address)
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)
geoCoordinates := msgraphsdk.NewOutlookGeoCoordinates()
requestBody.SetGeoCoordinates(geoCoordinates)
geoCoordinates.SetAltitude(nil)
latitude := float64(47)
geoCoordinates.SetLatitude(&latitude)
longitude := float64(-122)
geoCoordinates.SetLongitude(&longitude)
geoCoordinates.SetAccuracy(nil)
geoCoordinates.SetAltitudeAccuracy(nil)
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.roomList",
}
placeId := "place-id"
graphClient.PlacesById(&placeId).Patch(requestBody)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Calendar
$params = @{
"@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
Longitude = -122
Accuracy = $null
AltitudeAccuracy = $null
}
}
Update-MgPlace -PlaceId $placeId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following is an example of the response.
Note
The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$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"
}