Skip to main content
The First Step
September 11, 2024
Question

Trying to access number inventory via API

Hi.

I am working on an internal tool for my company to be able to onboard employees into ringcentral. I am able to create the users, but now I want to be able to assign them a number from the number inventory. 

I am able to successfully make the calls to reassign numbers but was wondering if there was a way to access the phone numbers in the inventory via the API? I want grab this data to be able to parse for specific area codes and then use the ids in the call to reassign numbers.

All I see in the documentation is a way to get the phone numbers attached to an extension. Is the number inventory an extension as well? If so where can i find its ID?

Thanks,
Hoon

2 replies

hoonkangThe First StepAuthor
The First Step
September 11, 2024

Did some more digging and apparently “NumberPool” is the usageType for numbers in the inventory. However, it seems I cannot use this as a search parameter for usageType when calling ```/restapi/v1.0/account/~/phone-number``` this endpoint…. It doesn’t return an error but just returns an empty array of records.

PhongVu
Community Manager
Community Manager
September 11, 2024

Can you use the V2 API and set the usageType to “Inventory”.