Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailbox Query does not properly escape quote symbols #1133

Open
harryoui opened this issue Feb 21, 2025 · 0 comments
Open

Mailbox Query does not properly escape quote symbols #1133

harryoui opened this issue Feb 21, 2025 · 0 comments

Comments

@harryoui
Copy link

The above query that contains a ' symbol in the subject filter:
query = mailbox.new_query().on_attribute('subject').contains("who's the best?")
Fails with:
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/users/.../messages?%24top=1&%24filter=contains%28subject%2C+%27who%27s+the+best%3F%27%29 | Error Message: Invalid filter clause: ')' or ',' expected at position 23 in 'contains(subject, 'who's the best?')'.

To properly escape single quotes in ms graph, they must be entered twice ( ' --> '' ):
query = mailbox.new_query().on_attribute('subject').contains("who''s the best?")

I'm unsure if this issue includes other characters that also need to be escaped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant