I get an error in Graph api using query parameters

智宏 立辻 41 Reputation points
2021-11-25T10:35:29.777+00:00

Hi threre!

I'd like to call the following graph api
「https://graph.microsoft.com/v1.0/devices?$filter=deviceid eq '[device id]'」
But I can't get an error 
「Error executing REST request: Invalid uri 'https://graph.microsoft.com/v1.0/devices?$filter=deviceid eq '[device id]'': Invalid query」

I have set Device.Read.All,Device.ReadWrite.All,Directory.Read.All,Directory.ReadWrite.All in API Permissions

Do you know the cause?

API Doc:https://learn.microsoft.com/ja-jp/graph/api/device-list?view=graph-rest-1.0&tabs=http

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,158 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 95,666 Reputation points MVP
    2021-11-25T14:44:03.31+00:00

    Works fine here, both on /v1.0 and /beta endpoints. Make sure you provide the actual GUID value, such as:

    https://graph.microsoft.com/v1.0/devices?$filter=deviceId eq 'd2503afc-5be6-4bb8-af13-38992c959cd4'
    

    Also, note that 'deviceId' is different from 'id', so make sure you're using the correct one.

    0 comments No comments