Finding the ticket by requester's phone number pattern | Community
Skip to main content

Finding the ticket by requester's phone number pattern

  • September 9, 2025
  • 1 reply
  • 0 views

Sumit11

i am calling zendesk rest API from my Backend systems.
i need to fetch all the tickets those matches the requester's phone Number pattern.
e. g. if give the searchPattern as “1234” it needs to search all the tickets of  the requester those have “1234” as part of there phone number .

i have used below endpoint as per some documentation i found online but its not working  (right now its matching only one requester,but i also need a pattern here as well):
https://8x8qatest.zendesk.com/api/v2/search.json?query=type:ticket requester.phone:+43211234


Any Suggesstion, or any other Rest endpoint i can use for my requirement.

1 reply

Ruben14
  • September 17, 2025

Sumit, the requester.phone filter isn’t a supported ticket search term, so that query won’t match on phone fragments.

 

Ticket search lets you use requester (name/email) or requester_id (exact user ID). The reliable pattern is: first find users whose phone contains your fragment, then fetch their tickets. (https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/)

 

  • Step 1: search users by phone substring, e.g. GET /api/v2/search.json?query=type:user phone:*1234* or GET /api/v2/users/search.json?query=1234 to catch phone numbers (normalize your digits to handle country codes).
  • Step 2: take the matching user IDs and query tickets with GET /api/v2/search.json?query=type:ticket requester_id:(123 456 789), or loop GET /api/v2/users/{id}/tickets/requested.json per user if the set is large. User search details are here for reference.

    (https://developer.zendesk.com/api-reference/ticketing/users/users/#search-users)

Two tips from experience: strip non-digits before building the query so +1-234-… and 1234 both hit, and prefer the requester_id:(…) search for fewer calls when the candidate user list is short.