question

robert-eckman avatar image
robert-eckman asked ·

API Get Extension details don't have businessPhone for users

I created a C# console application to access the RingCentral API using the RingCentral SDK.

With this application, I am pulling a list of calls, and then I pull a list of users, and I import that stuff into our data warehouse for analysis and reporting.

However, when I pull the user records via the [Get Extension] (https://developers.ringcentral.com/api-reference/User-Settings/readExtension), my list of users don't have phone numbers. They should have a phone number, as most of them have a direct number that their clients can reach them at. How do I go about to get the direct numbers of my users via the API? It seems as if the "businessPhone" attribute is not populated. Even when I test it against my account, it's blank.

It seems to me that I will need to pull the [Get Company Phone Numbers] (https://developers.ringcentral.com/api-reference/Phone-Numbers/listAccountPhoneNumbers) and then match the extension/id to that of the extension/id of my user table to get what I want. Basically more steps that I'll have to build out into my application and in the database... why doesn't the GetExtension pull this information by default??

apic#users
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
Phong Vu avatar image
Phong Vu answered ·

After you get a list of extensions, parse the extension id of each extension then call this endpoint to get a list of that extension's phone numbers.

HTTP GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/phone-number

https://github.com/ringcentral/RingCentral.Net/blob/master/samples.md#get-extension-phone-number-list

1 comment Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

That would work, but with approximately 1500 extensions, I don't want to make a call for each, since there is a limit to how often I can hit the API from my understanding. Instead, I went ahead and pulled the [Get Company Phone Numbers] list and used that table's extension id to match to my user's extension id, and it worked. So the issue is resolved now.

1 Like 1 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.