Zendesk Search API
BeantwortetHi There, I'm new to Zendesk and trying to figure out how to use the API's.
I'm currently using Postman to query the search API to provide all the tickets associated with a user based on email or telephone. I'm trying to present a screen pop showing all tickets for the user when they call/email in.
I have the following query:
https://{platform}.zendesk.com/api/v2/search?query=email:"user.email@gmail.com"&query=type:ticket status:open.
However, I receive all open tickets, not just for user.email@gmail.com. I'm sure this is a very basic mistake so please excuse my ignorance.
-N
-
Hi Neil MacColl
You need to specify the user role in the ticket (e.g. requester, assignee). For tickets requested by the user, the request url inclduing the query should be as follows:
https://{platform}.zendesk.com/api/v2/search?query=type:ticket requester:user.email@gmail.com
Best,
Ahmed -
Hi Ahmed,
Thank you. This now works! appreciate the support.
-
Hi Ahmed,
Do you perhaps know why this doesn't work with phone numbers?
-
Hello Neil,
If you mean to look for the ticket requester using their phone number, it won't work. The requester attribute of the query accepts either user id or email address. You can however look for user using their phone number. Try the following query:
query=type:user phone:"+123456789"
Best Regards,
Ahmed
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
4 Kommentare