Graph API get Users API request error

Jay Lin 0 Reputation points
2025-01-28T18:27:04.9966667+00:00

I am attempting to List the Users in my application via API request in Postman. I am getting the following error however:

{ "error": { "code": "Authorization_RequestDenied", "message": "Insufficient privileges to complete the operation.", "innerError": { "date": "2025-01-27T21:56:17", "request-id": "5fc0b534-fadc-4557-87df-0576017dc6be", "client-request-id": "5fc0b534-fadc-4557-87df-0576017dc6be" } } }

I'm not sure what perms I'm still missing, or if my request is wrong. Here's the list of perms I have for this app:

ed7849f7-cfbf-4cfa-bc4c-c5414bf3006b

Here's my API request:

curl --location --request GET "https://graph.microsoft.com/v1.0/users" ^ --header "Content-Type: application/json" ^ --header "Authorization: Bearer {TOKEN}"

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,978 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Akhil Nasalwai - MSFT 180 Reputation points Microsoft Vendor
    2025-01-28T23:51:50.3066667+00:00

    Hello Jay Lin,

    Thank you for reaching out to Microsoft!

    For fetching the list of users in your application via API request in Postman, you can try the following mentioned workarounds as per the error mentioned.

    Try granting application permissions to the app in the Entra portal and Grant admin consent, generate a new token and execute the API to get the list of all users using application permissions as per the documentation referenced below.

    Link: Get users via Graph API

    Else, try executing the Graph API by signing in as a user in the Graph explorer to get the list of users.

    Here is the link for troubleshooting the error mentioned.

    Link: Troubleshoot Authorization Request denied using Graph API

    You can decode the token using jwt.ms/jwt.io to check the roles and permissions.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Yakun Huang-MSFT 9,780 Reputation points Microsoft Vendor
    2025-01-29T01:41:20.9866667+00:00

    Hello Jay Lin,

    Thank you for reaching out to Microsoft Support!

    In response to your question, we have tested the endpoint and everything is fine, the test results are as follows:

    Screenshot 2025-01-29 013911

    According to your screenshot, the permissions you have granted are sufficient. What you need to check is whether your token has these permissions. Please parse the token in jwt.ms and check whether there is User.ReadBasic.All permission in "scp". This endpoint does not support a personal Microsoft account.

    Reference document:

    https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.