How are single quotes escaped in filter query string values?

Filter API calls for tickets, contacts, and so on (e.g. filter tickets) require string values to be enclosed in single quotes:

query?"some_string_field:'some value'"

How are string values that contain single quotes represented?

query?"some_string_field:'fred's car'"

Should the internal single quote be double URL-encoded? Escaped with a slash? Or are strings containing single quotes simply invalid for use in filters?

Hi @jsd
Welcome to the community!

AFAIK, you can do the escaped with a backslash.

Thanks

Backslashes do not work to allow string values that contain single quotes. A request to api/v2/search/contacts?query="email='test+\'@gmail.com'" results in a validation failure. The same API request without the \' works as expected.

@jsd,
Let me check with the product team and get back at the earliest

Thanks

2 Likes

@jsd,
I had checked with the product team and it wont work on Filter ticket API and it’s been a known bug for quite sometime, As of now there is no workaround is what the team said.

Hope it helps :slight_smile:

Thanks

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.