Jump to content
  • 0
Avneet Singh

phone number

Question

Hello All,

Is there any phone number's api to differentiate "spare numbers" and "number in use" . Also is there any api to describe that phone number is assigned to which user .

Thanks 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Yes
https://github.com/2600hz/kazoo/blob/master/applications/crossbar/doc/phone_numbers.md
or
https://docs.2600hz.com/supported/applications/crossbar/doc/phone_numbers/

/v2/phone_numbers?prefix={PREFIX}&quantity={QUANTITY}&offset={OFFSET}&country={COUNTRY} should return numbers, and their status. Don't know if it shows who it is assigned to. Worst case, you could loop through accounts and use GET /v2/accounts/{ACCOUNT_ID}/phone_numbers

Someone might know a better method, or you can look at how the number manager in monsterui does it.

Share this post


Link to post
Share on other sites
  • 0

AFAIK, only way to do this is to use /v2/accounts/{account_id}/phone_numbers

If you set account_id to your root re-seller account, it will return all numbers for subaccounts also and you can loop through them/page through. You can also apply filters, such as "?filter_state=in_service or ?created_from=63627345744

in_service should mean that it's assigned to a callflow. avaialble should mean that it is not assigned to a callflow. You can look at the assigned_to field to see if it's assigned to a subaccount/an account other than your root re-seller account.

Share this post


Link to post
Share on other sites
  • 0

Number states can be read about more here: https://docs.2600hz.com/dev/core/kazoo_number_manager/doc/number_states/

I'm not sure what monster-ui uses to determine "spare" vs "in-use"; @azefiel ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×