Getting a list of dial-in numbers

Last updated: 2023-05-02Contributors
Edit this page

RingCentral Video REST API and Client SDKs are in beta

The RingCentral Video REST API and Client SDKs are currently in beta. Developers should be aware of the following:

  • Their feature sets are not reflective of the full scope currently planned.
  • Backwards compatibility is not guaranteed from one release to the next during the beta period. Changes can be introduced at any time that may impact your applications with little notice.
  • Video APIs are not currently available in our sandbox environment and developers are asked to do development in our production environment.

When composing an invite to a meeting, it is often important to provide participants with dial-in information if they do not have immediate access to a computer. RingCentral provides dial-in information for countries around the world. These phone numbers do not change often, but if they do, this API will ensure you are always providing correct and current information.

const RC = require('@ringcentral/sdk').SDK
require('dotenv').config();

const CALLER       = process.env.RINGOUT_CALLER
const RECIPIENT    = process.env.RINGOUT_RECIPIENT

var rcsdk = new RC({
    'server':       process.env.RC_SERVER_URL,
    'clientId':     process.env.RC_CLIENT_ID,
    'clientSecret': process.env.RC_CLIENT_SECRET
});
var platform = rcsdk.platform();
platform.login({ 'jwt':  process.env.RC_JWT })

platform.on(platform.events.loginSuccess, () => {
  call_ringout()
})

async function call_ringout() {
    try {
    var resp = await platform.get('/restapi/v1.0/account/~/extension/~/conferencing')
    var jsonObj = await resp.json()
    console.log( jsonObj )
    } catch (e) {
    console.log(e.message)
    }
}

When run, the sample code above should return something that looks like the following. Your actual result may contain different numbers and is likely to be much larger:

{
  phoneNumbers: [
    {
      phoneNumber: '+16504191505',
      country: [Object],
      default: true,
      location: 'San Mateo, CA'
    },
    { phoneNumber: '+18885110509', country: [Object], default: false },
    {
      phoneNumber: '+541159842371',
      country: [Object],
      default: false,
      location: 'Buenos Aires'
    },
    {
      phoneNumber: '+61862450610',
      country: [Object],
      default: false,
      location: 'Perth'
    },
    {
      phoneNumber: '+61283104136',
      country: [Object],
      default: false,
      location: 'Sydney'
    }
  ]
}

Rate this page: