Pragya Bharati
Pragya Bharati

Reputation: 41

Azure AD B2C: Microsoft Graph API Error - Property 'mobile' does not exist as a declared property or extension property

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."

Upvotes: 0

Views: 3159

Answers (1)

Sruthi J
Sruthi J

Reputation: 1602

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

Upvotes: 0

Related Questions