The_Exchange_Team
This week I once again tried to update the room attributes of "Conference Rooms" as well as "Workspaces" - this time via the places API.
I used MS Graph Explorer to list "all" places -- well, apparently "Workspaces" are excluded from the places API response - which I figured out later.
To list all "Conference Rooms", I used:
GET https://graph.microsoft.com/beta/places/microsoft.graph.room
To list all "Workspaces", I used:
GET https://graph.microsoft.com/beta/places/microsoft.graph.space
So far so good.
Now I successfully updated the attributes of a specific "Conference Room":
PATCH https://graph.microsoft.com/beta/places/<placeId>
Content-type: application/json
{
"@odata.type": "microsoft.graph.room",
"building": "A",
"floorNumber": 1,
"floorLabel": "Floor Level 1",
"label": "Building A",
"capacity": 12,
"audioDeviceName": "Jabra Speaker large",
"videoDeviceName": "Beamer, ClickShare",
"displayDeviceName": "Beamer canvas",
"isWheelChairAccessible": false,
"tags": [
"RoomType: Meeting Room",
"Equipment: Beamer"
]
}
Works like a charm and the updated attributes were instantly available in RoomFinder.
However, I currently struggle to update the room attributes of "Workspaces".
I can manage to get a specific "Workspace" by means of this API call:
GET https://graph.microsoft.com/beta/places/<placeId>
Content-type: application/json
When I try to update (PATCH) the attributes of a "Workspaces" place, I receive an 404 response.
*request body*
```json
{
"@odata.type": "microsoft.graph.room",
"building": "B",
"floorNumber": 1,
"floorLabel": "Floor Level 1",
"label": "Building B",
"capacity": 2,
"isWheelChairAccessible": true,
"tags": [
"RoomType: Hot Desk"
]
}
```
*response*
```json
{
"error": {
"code": "UnknownError",
"message": "{\"code\":\"invalid_place\",\"message\":\"place in /locations/odata/api/v2.0/places('<placeId>') not found\"}",
"innerError": {
"date": "2022-04-08T16:33:35",
"request-id": "<request-id>",
"client-request-id": "<client-request-id>"
}
}
}
```
I also considered to modify the @odata.type to "microsoft.graph.space" which resulted in an 400 error:
*request body*
```json
{
"@odata.type": "microsoft.graph.space",
"building": "B",
"floorNumber": 1,
"floorLabel": "Floor Level 1",
"label": "Building B",
"capacity": 2,
"isWheelChairAccessible": true,
"tags": [
"RoomType: Hot Desk"
]
}
```
*response*
```json
{
"error": {
"code": "",
"message": "Update request has to be for a tenant Room or RoomList.",
"innerError": {
"date": "2022-04-08T16:41:05",
"request-id": "<request-id>",
"client-request-id": "<client-request-id>"
}
}
}
```
How can I update "Workspaces" room attributes by means of the places API ??? HELP HIGHLY APPRECIATED 