question

James Smith avatar image
James Smith asked Phong Vu commented

Is there an API endpoint that contains Direct Number for an extension from RingCentral?

I am looking at the extensions API and I see a businessPhone in the payload. It turns out that this is the best contact number and we do not give most users the ability to update this field. We need to be able to access the direct number assigned to them in RingCentral. Can that be found in an API? The extensions API does provide us with the additional information we need, but I do not see the direct phone number.

rest api
1 comment
1 |3000

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

James Smith avatar image James Smith commented ·

I think I have found the API endpoint I am looking for

https://developers.ringcentral.com/api-reference/Phone-Numbers/listExtensionPhoneNumbers


but this doesnt give me the result set I expect, even when I add the filter below, I still get multiple records back for just one extension ID. Any help anyone could provide would be greatly appreciated?

usageType=DirectNumber
0 Likes 0 ·

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

Based on your own comment, you want to read direct number of all extensions under your account, right? If that is what you expected, use the account phone number endpoint.

var endpoint = `/restapi/v1.0/account/~/phone-number` 
var params = {
        usageType: [ "DirectNumber" ]
        }
28 comments
1 |3000

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

James Smith avatar image James Smith commented ·

Well no what I need comes from the extensions endpoint. Unfortunately, the phone number there, labeled businessPhone, is nothing but the best contact phone number, which is blank for most of our records. I thought it was the direct RingCentral number for that extension. Since that is not the case, I posted this question, but soon after found the endpoint reference page that I listed in my comment, which pulls phone numbers for a given extension id. I then added the uri parameter to limit the results to "DirectNumber", but I am still getting multiple phone numbers for a single extensionId?

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ James Smith commented ·

Gotcha. Because you mentioned the DirectNumber so I misunderstood your need.

I think the `/phone-number` endpoint should support the BusinessMobileNumber as it's shown in the documentation. But some how the API does not return the number. I will check with the team to see what could be wrong with that.

Meanwhile, I guess that you want to read the Mobile phone specified in the user details, right? If so, the only way to read that number of all extensions is to call this API and parse the 'contact' object in the response to get the businesPhone number. This will shown the Mobile Phone of a user as display in the User Details

1648751793130.png

0 Likes 0 ·
1648751793130.png (40.9 KiB)
James Smith avatar image James Smith Phong Vu ♦♦ commented ·

No I want the DirectNumber, but when I filter for directNumber for a specific extension, I get multiple records back.. I already have the businessPhone from the extension API call, but businessPhone is misleading. As you pointed out, its best contact number and for our account it is blank for most users, so businessPhone is a misleading name. I just need to get the RingCentral assigned main phone number for a given extension (we want to pull it for all extensions i.e. employees).From my research the that number should be the DirectNumber.

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys