0
votes

I am trying to search user using Microsoft Graph API and it works for few attribute like filter=givenName https://graph.microsoft.com/v1.0/users?$filter=givenName eq 'testuser'&$select=surname

I want to search user with mobile number, tried https://graph.microsoft.com/v1.0/users?$filter=mobile eq '+******'&$select=surname

It gives me an error:

"code": "Request_UnsupportedQuery", "message": "Property 'mobile' does not exist as a declared property or extension property."

1
Currently, it is working in beta for Azure Ad but there is an issue in B2C. Please refer to this Github and update you accordingly - Sruthi J
I tried https://graph.microsoft.com/beta/users?$select=surname,mobilePhone&$filter=mobilePhone eq '123456'&$count=true and it worked. - Pamela Peng
@PamelaPeng did that work for B2C? - Thom Hubers
@ThomHubers The $count and $search parameters are currently not available in Azure AD B2C tenants, see here. - Pamela Peng

1 Answers

0
votes

Currently, you can use the below query for AAD to filter the users by using ConsistencyLevel:eventual

https://graph.microsoft.com/beta/users?$select=id,displayName,mobilePhone&$filter=startswith(mobilePhone,'***')&$count=true
ConsistencyLevel:eventual 

enter image description here

For Azure ADb2c users filter query with counts and Consistency=eventual is actually not supported for B2C tenants. For more information please refer to this