Solved

Query contacts by handle

  • 22 December 2022
  • 2 replies
  • 36 views

Badge +2

I'd like to find a more efficient way to look up a specific contact in front when I don't have the contact id or the conversation id. Ideally I could query the contacts by the phone number but I can't find a way to do that without paginating through all the contacts. Am I missing something or is this intentional?

icon

Best answer by Support Engineering 22 December 2022, 18:05

View original

2 replies

Userlevel 1
Badge +5

We have a tool just for this - it's called resource aliases.

 

For example, if a contact with the phone +1415-555-0000 has contact ID crd_1, both the following API calls will return the same:

 

GET /contacts/crd_1

GET /contacts/alt:phone:+14155550000

 

I hope that helps! 

 

--Jason

Badge +2

Thank you! This is exactly what I need.

Reply