question

JoshuaChung-1093 avatar image
0 Votes"
JoshuaChung-1093 asked azure-cxp-api edited

userPrincipleName

Hello,

I'm in need of an API where I can run something like GET /users/"Joshua Chung" and then all users who have a match to the name (Joshua Chung) will get listed along with the user's UPN.

Is there an API that allows this type of feature?

azure-ad-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

SaurabhSharma-msft avatar image
1 Vote"
SaurabhSharma-msft answered SaurabhSharma-msft edited

You can use Microsoft Graph API endpoint https://graph.microsoft.com/v1.0/users and use $filter query parameter to get list of users which meets the filter criteria. For example - To get users having display name starts with "Joshua Chung", the syntax is as follows:

 GET https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'Joshua Chung')

Please refer to the documentation to know more about using Microsoft Graph Users endpoint. Also, refer to documentation to learn more about Query parameters.

You can also refer to Microsoft Graph auth overview to get the authorization tokens and Use the Microsoft Graph API to use tokens for calling Microsoft Graph REST API's. You can also use Microsoft Graph Explorer
to test requests using Microsoft Graph APIs.


· 1
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.

@JoshuaChung-1093 Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

0 Votes 0 ·