Using search api to find end user details (using emaiid as query parameter)



Data ultimo post: 06 gen 2022

Hi Team,

We are trying to search user in zendesk system using user email through Zendesk API.

The curl command for the search API is as bellow:

curl "https://MYDOMAIN.zendesk.com/api/v2/search.json" \
-G --data-urlencode "query=email:XXXX@MYDOMAIN.com" \
-v -u steve@MYDOMAIN.com/token:----some-----secret-token---here

This sometimes gives result for some of the emails but not for some other emails.

Example emails which exists in zendesk but does not give any result when searched using above curl command:

user+1@mydomain.com (does not work)

user+3@mydomain.com (works)

user@mydomain.com (does not work)

Can someone suggest what are we missing in the curl command ?


1

15

15 commenti

      Hi Chandrajyoti Das,

      Sorry for the delay in getting back to you!

      Can you try URL encoding any special characters in the local-part of the email address i.e user%2B1@mydomain.com in place of user+1@mydomain.com. Also, the wildcard operator does not work for email hence why you would have received no responses for query="Chandra*. 

      Let me know if this helps!

      Tipene 

      0


      Hi Tipene Hughes,
      Any update on this? 

      0


      Also I tried bellow query :

      curl https://banknovo.zendesk.com/api/v2/search.json?query=“Chandra*” -v -u steve@MYDOMAIN.com/token:----some-----secret-token---here

      This also didn’t give results.

      So can I get some other solution on this?

      0


      Hi Tipene,
      I tried as per your suggestion, but result is same...
      Is there any other way?

      0


      Hi Chandrajyoti Das,

      Thanks for reaching out!

      First thing I'd suggest trying is adding the type keyword to explicitly declare that you're wanting to search for users:

      "query=type:user email:XXXX@MYDOMAIN.com"

      Let me know if this helps!

      Tipene

      0


      Accedi per lasciare un commento.

      Non hai trovato quello che cerchi?

      Nuovo post