I get an error in Graph api using query parameters

智宏 立辻 41 Reputation points

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.
34,833 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 90,396 Reputation points MVP

    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