Fresdesk Unable to search contacts by name

Hello There,

I’m trying to use
/api/v2/contacts/autocomplete?name=[keyword]
or
/api/v2/search/contacts?query=[query]

In both case I have an issue

curl -u MY_TOKEN:X  -X GET 'https://DOMAIN.freshdesk.com/api/v2/search/contacts?query="(name:John)"'
{"description":"Validation failed","errors":[{"field":"name","message":"Unexpected/invalid field in request","code":"invalid_field"}]}%
curl -u MY_TOKEN:X  -X GET 'https://DOMAIN.freshdesk.com/api/v2/contacts/autocomplete?name=JOHN'
{"description":"Validation failed","errors":[{"field":"name","message":"Unexpected/invalid field in request","code":"invalid_field"}]}%

I think I’m missing something, but according to the doc it seems fine …
What am I missing ? :slight_smile:

Regards,

Hi @Anthony_Martinet
Good day!
Welcome to the community!

as per the document you need to pass the correct query string

/api/v2/agents/autocomplete?term=[keyword] 

As per the document, there are no such params called name, Kindly refer the supported contact fields section for more reference

Hope it helps :slight_smile:

Thanks

Hi @Santhosh !

Thanks for the answer.
You are pointing me to the Agent API, but I’m looking for Contact here !

I can see now that the doc has change … it was autocomplete?name=[keyword] and now the doc seems to use autocomplete?term=[keyword] :slight_smile:

1 Like

@Anthony_Martinet,
My bad, I had update the answer, I hope you are able to get the proper response now :slight_smile:

Thanks