Skip to main content

Hi Fresh team -- new to this so I have a question. I know there is a filter that can be used to query for fields but it appears it does not like hypen when searching for a record as a parameter. For example:
https://domain.freshdesk.com/api/v2/contacts?query="phone:AAA-BBB-XXXX" 

 

"errors": :

{

"field": "query",

"message": "Unexpected/invalid field in request",

"code": "invalid_field"

}

 

Is there a way to query for a phone number regardless of the format? Whether be e.164, with parenthesis or hyphen? I did mention to the admin that they will need to change their contacts’ phone field format and make them all the same.

Hi ​@e2nlabs,

I hope you are doing well. Sorry for the delayed response.

To perform a query for a phone number regardless of format in Freshdesk, you can try enclosing the phone number in quotes and using single quotes inside the query parameter, like this:

https://domain.freshdesk.com/api/v2/search/contacts?query="phone:'AAA-BBB-XXXX'"

If the "+" symbol is part of the phone number, encode it as "%2B". This approach should help ensure that the search works regardless of the format. However, note that there is no current functionality to normalize formats automatically; the entered phone numbers need to be in consistent formats for more precise searches.

Adjusting the contact phone field format within the system for consistency is helpful.

Thank you !!


Reply