Skip to main content
Answer

Query contacts by handle

  • December 22, 2022
  • 2 replies
  • 88 views

Front Developer
Forum|alt.badge.img+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?

Best answer by Support Engineering

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

2 replies

Forum|alt.badge.img+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


Front Developer
Forum|alt.badge.img+2

Thank you! This is exactly what I need.