msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Get-mgplace returns 406 (not acceptaple)

Open Michael19842 opened this issue 3 years ago • 6 comments

Get-mgplace returns 406 (not acceptaple)
AB#7400

Michael19842 avatar Oct 08 '20 15:10 Michael19842

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

Michael19842 avatar Oct 08 '20 15:10 Michael19842

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.

ddyett avatar Oct 08 '20 18:10 ddyett

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).

peombwa avatar Oct 08 '20 20:10 peombwa

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!

NunoFilipeMota avatar Feb 16 '22 12:02 NunoFilipeMota

Seems to be dead :S

Michael19842 avatar Feb 16 '22 13:02 Michael19842

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.

jetedoff avatar Aug 22 '22 13:08 jetedoff

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: image

peombwa avatar May 25 '23 20:05 peombwa