Microsoft Graph API - Tips and Solutions
Helpful Graph Explorer
The Microsoft Graph Explorer is a web-based tool for developers to test and explore Microsoft Graph API. To access it, go to https://developer.microsoft.com/en-us/graph/graph-explorer/ .
Increase Page Size
By default, Microsoft Graph API returns a maximum of 100 items per request. However, you can increase the page size up to a maximum of 999 items per request by using the $top
parameter in your API requests.
To increase the page size, simply add the $top
parameter to your request URL, followed by the number of items you want to retrieve. For example, to retrieve 200 items, you would add $top=200
to your request URL.
Here's an example request URL that retrieves the top 999 users:
https://graph.microsoft.com/v1.0/users?$top=999
Expand Manager
The manager property of a user resource in Microsoft Graph API contains the user ID of the user's manager. To retrieve the manager's details for a specific user, you can use the /users
endpoint with the $expand
parameter in your API request.
https://graph.microsoft.com/v1.0/users?$expand=manager
This request will return the details of the user's manager in the manager
property of the response.
You can also expand multiple properties at once by separating them with a comma.
Select Single User by Email
To select a single user by email, you can use the /users
endpoint with a filter query parameter that specifies the user's email address. For example, to retrieve the details of a user with the email address example@example.com
, you can use the following request URL:
https://graph.microsoft.com/v1.0/users?$filter=mail eq 'example@example.com'
Get employeeOrgData
The employeeOrgData
property is a complex type that contains the organization-specific data for a user. To retrieve the employeeOrgData
property for a user, you can use the /users
endpoint with the $select
query parameter.
https://graph.microsoft.com/v1.0/users/{id|userPrincipalName}?$select=id,employeeOrgData