question

LiangJoneGTSCNNONJJ-6003 avatar image
0 Votes"
LiangJoneGTSCNNONJJ-6003 asked JamieJamieson-0749 edited

Unsupported or invalid query filter clause specified for property 'mobilePhone' of resource 'User'

when I request to https://graph.microsoft.com/v1.0/users?$filter=mobilePhone eq '13111111111'&$count=true response is 'Unsupported or invalid query filter clause specified for property 'mobilePhone' of resource 'User'',I change request to https://graph.microsoft.com/v1.0/users?$count=true&$filter=mail eq '13111111111' it's working

microsoft-graph-files
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.

JanardhanaVedham-MSFT avatar image
1 Vote"
JanardhanaVedham-MSFT answered JamieJamieson-0749 edited

Hi @LiangJoneGTSCNNONJJ-6003 ,

As documented here, mobilePhone property does supports filter OData query parameter and it seems to be issue with API and this API filter query is not working as expected. I would advise you to use the below alternative filter API query along with request header (ConsistencyLevel: eventual) as shown below and it is working fine.

 GET https://graph.microsoft.com/v1.0/users?$filter=mobilePhone eq '1234567890'&$count=true
 ConsistencyLevel: eventual 

(Or)

 GET https://graph.microsoft.com/v1.0/users?$filter=startsWith(mobilePhone, '1234')&$count=true
 ConsistencyLevel: eventual 

199491-image.png

For escalating this API issue regarding normail filter query with mobilePhone property to Microsoft Engineering team for thier analysis & resoultion , I would request you to open up a support case either from your Azure portal or M365 admin portal and please mention "Graph API" term in your issue description for quick assignment with our MS graph customer support team. Thanks for your understanding.

Hope this helps.

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


image.png (50.1 KiB)
· 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.

I am running my query against an AD B2C repository.

I have tried all of the above, specifically:

  • Setting the ConsistencyLevel header to "eventual"

  • Adding the $count=true directive

  • Using "startsWith" rather than "eq"


I am still getting the 'Unsupported or invalid query filter clause specified for property 'mobilePhone' of resource 'User'

I can filter on the other properties ("givenName", "surname", etc...) so there does not appear to be anything intrinsically wrong with the way in which I am performing queries.

Does MSGraph implement "mobilePhone" as a filter option for B2C? The online documentation doesn't indicate that B2C doesn't allow it.



0 Votes 0 ·
CarlZhao-MSFT avatar image
0 Votes"
CarlZhao-MSFT answered LiangJoneGTSCNNONJJ-6003 commented

Hi @LiangJoneGTSCNNONJJ-6003

This is because you are missing the ConsistencyLevel: eventual header. Also, I think if you call https://graph.microsoft.com/v1.0/users?$count=true&$filter=mail eq '13111111111' api without ConsistencyLevel: eventual header , it should not work, please check.

Refer to: Advanced query capabilities on Azure AD directory objects.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

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