Reputation: 103
I'm trying to query users by displayName, but I have trouble escaping single quote when sending the request by both C# SDK and Graph Explorer.
Update: It's not clear in the example, the search term I have trouble with is I'
Example query: https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I%27') results in
Status Code: 400
{
"error": {
"code": "BadRequest",
"message": "There is an unterminated string literal at position 28 in 'startsWith(displayName,'I'')'.",
// snip
}
}
I tried all sorts of escaping, with backslashes, double quotes, %2527
instead of the quote, nothing works. What's the proper way to query with a quote?
Upvotes: 10
Views: 9237
Reputation: 1704
https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'I''')
SQUOTE-in-string = SQUOTE SQUOTE ; two consecutive single quotes represent one within a string literal
Upvotes: 16