Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[MS Graph]: Handling special characters in string search in a MS graph query

I am searching for an object with a display name. MS graph throws an exception if it contains & or # withing the search string. Is there a way around this??

https://graph.microsoft.com/XXXXXXXXXXXXXXXXXXXXXXXXXXXX?$filter=displayName eq 'application # manager'
like image 585
user3447478 Avatar asked Sep 14 '25 11:09

user3447478


1 Answers

You need to URL encoding the '#' in the request.

For example below request will help you in querying 'application # manager',

https://graph.microsoft.com/v1.0/users?$filter=displayName eq 'application%20%23%20manager'

For more details look in to Output in my environment below:-

enter image description here

like image 135
Sri Hari Krishna Yalamanchili Avatar answered Sep 17 '25 18:09

Sri Hari Krishna Yalamanchili