msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Get-mgplace returns 406 (not acceptaple)
Get-mgplace returns 406 (not acceptaple)
AB#7400
Get-MgPlace : The server responded with a Request Error, Status: NotAcceptable At line:1 char:1
- Get-MgPlace -Top 10 -Debug
-
+ CategoryInfo : InvalidOperation: ({ Top = 10, Ski...ndProperty = }:<>f__AnonymousType15`8) [Get-MgPlace_List], RestException`1 + FullyQualifiedErrorId : UnknownError,Microsoft.Graph.PowerShell.Cmdlets.GetMgPlace_List
DEBUG: HTTP/1.1 406 Not Acceptable request-id: ac13c32f-f9ab-4914-b6ac-9005f37e8f2a client-request-id: ac13c32f-f9ab-4914-b6ac-9005f37e8f2a x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_33"}} Strict-Transport-Security: max-age=31536000 Cache-Control: private Date: Thu, 08 Oct 2020 15:15:20 GMT Content-Length: 266 Content-Type: application/json
i think you need a placeId such as microsoft.graph.room to get back some information. get-mgplace -placeid microosft.graph.room. places itself is abstract. @peombwa everything seems to be ending up in additionalproperties.
This is because in the OpenAPI doc, /places/{place-id}
returns a single microsoft.graph.place
entity and not a collection.
We should consider adding room type parameter to /places
or generate paths for all room types (OData cast).
Any development on this? I'm also getting the NotAcceptable error and can't find a way of getting all Places/Meeting Rooms using the SDK and the Get-MgPlace command... Thank you!
Seems to be dead :S
Pinging this thread again, is there any code fixing happening for *-MgPlace? I can't steer customers away from Azure PowerShell and tell them to adopt Graph PowerShell if the code doesn't work, yet documentation says to do just that.
Fixed by https://github.com/microsoftgraph/msgraph-sdk-powershell/releases/tag/2.0.0-rc1.
OData cast support was added to V2 of the SDK via Get-Mg*As<DerivedType>
convention. Please use, Get-MgPlaceAsRoom
to get a collection of places as rooms: