Skip to main content
Solved

Query extension by phone number

  • December 24, 2021
  • 2 replies
  • 379 views

  • New Participant
  • 1 reply

I have to write an app that sets a call forwarding destination for a user. In order to call the API I need an extension ID.

/restapi/v1.0/account/~/extension/'+extId+'/forwarding-number

However, all I have is the users DDI phone number to query with. So it would appear I have to first get a complete list of all phone numbers on the system and this will include their extension IDs.

/restapi/v1.0/account/~/phone-number

From there, I can use this list to lookup the extension ID for a specific phone number. I have over 25K users on the system. This takes time and puts load on the system. Is there no way to query just one phone number and get just it's details?

Thanks.

Best answer by PhongVu

You can call this API to search by phone number. However, the API rate limit group is heavy, which means you can call the API max 10 times per min. If you need to search more often, the best way is to read extensions' numbers once and keep them in your own database/array and implement your own search. Of course, you need to keep track of extension number changed to update your list. One way to do that is to listen to extension event notification and detect the changes.

Check out this filters

https://developers.ringcentral.com/api-reference/Extension-List-Event

https://developers.ringcentral.com/api-reference/Company-Directory-Event

View original
Did this thread help you find an answer to your question?

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2423 replies
  • Answer
  • December 27, 2021

You can call this API to search by phone number. However, the API rate limit group is heavy, which means you can call the API max 10 times per min. If you need to search more often, the best way is to read extensions' numbers once and keep them in your own database/array and implement your own search. Of course, you need to keep track of extension number changed to update your list. One way to do that is to listen to extension event notification and detect the changes.

Check out this filters

https://developers.ringcentral.com/api-reference/Extension-List-Event

https://developers.ringcentral.com/api-reference/Company-Directory-Event


  • Author
  • New Participant
  • 1 reply
  • December 27, 2021

Many thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings