question

ABBAADAMIBRAHIM-6942 avatar image
0 Votes"
ABBAADAMIBRAHIM-6942 asked LuDaiMSFT-0289 commented

Graph API endpoint to list Managed Devices throwing 401 Forbidden error

My GET request https://XXX.manage.microsoft.com/ReportingService/DataWarehouseFEService/devices?api-version=v1.0 and GET /deviceManagement/managedDevices

is failing with the following error, can any have any idea please ? thanks !

{ “ErrorCode”: “Forbidden”, “Message”: “{\r\n \”_version\”: 3,\r\n \”Message\”: \”An error has occurred – Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 – Activity ID: 679XXXX-37c2-4ba3-90bf-xxx – Url: https://XXX.manage.microsoft.com/ReportingService/DataWarehouseFEService/devices?api-version=v1.0”,rn \”CustomApiErrorPhrase\”: \”\”,\r\n \”RetryAfter\”: null,\r\n \”ErrorSourceService\”: \”\”,\r\n \”HttpHeaders\”: \”{\\”WWW-Authenticate\\”:\\”Bearer realm=\\\\”urn:intune:service,xxxxx73-f703-4a4e-85e4-58016xxxx3cfa7,fxxxx-59bf-4f0d-b1b2-0ef84ddfe3c7\\\\”\\”}\”\r\n}”, “Target”: null, “Details”: null, “InnerError”: null, “InstanceAnnotations”: [] }

Permission and autorisation

120457-capture-decran-2021-08-04-a-110301.png


mem-intune-device-configurationsmem-intune-graph
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LuDaiMSFT-0289 avatar image
0 Votes"
LuDaiMSFT-0289 answered LuDaiMSFT-0289 commented

@ABBAADAMIBRAHIM-6942 Thanks for posting in our Q&A. From your description, I know that you want to list managed devices via Graph API. If there is anything misunderstanding, feel free to let us know.

For this issue, please try to click "F12" and then click on "All devices" in intune portal. It will shows the Request URL. For example:
120723-image.png

When we use the URL in Graph Explorer, it will list the information about managed devices in Response.
120712-image.png

Hope it will help.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (45.7 KiB)
image.png (86.3 KiB)
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ABBAADAMIBRAHIM-6942 I am currently standing by for further update from you and would like to know how things are going. If you have any questions or concerns on the recent information I've provided you, please don't hesitate to let me know.

0 Votes 0 ·

Hello, thanks you for your help,

which permissions i need to enable ?

!121540-capture-decran-2021-08-09-a-102438.png


0 Votes 0 ·

@ABBAADAMIBRAHIM-6942 Thanks for your update.

From the picture, it seems that there is no devices in intune. And the unauthorized error shows that there is something wrong with the login account. Did you use the Azure AD account to login the intune portal?

0 Votes 0 ·
Show more comments