question

Chaitali avatar image
Chaitali asked mary-community-moderator edited

listing the extension details

We have multiple extension we are working with.

We want to list all the details of all the extension under the account. What is the best way to do that?

rest api
1 |1500 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.

Phong Vu avatar image
Phong Vu answered

First of all, your app must have the ReadAccounts permission. Then write your code to login with an admin user (e.g. the extension 101) and call the Get Extension List API. Here is some code snippet in Node JS.

var SDK = require('ringcentral

RINGCENTRAL_CLIENTID = 'your-app-client-id'
RINGCENTRAL_CLIENTSECRET = 'your-app-client-secret'
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'

RINGCENTRAL_USERNAME = 'maincompanynumber'
RINGCENTRAL_PASSWORD = 'user-password'
RINGCENTRAL_EXTENSION = '101'

var rcsdk = new SDK({
      server: RINGCENTRAL_SERVER,
      appKey: RINGCENTRAL_CLIENTID,
      appSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();
platform.login({
      username: RINGCENTRAL_USERNAME,
      password: RINGCENTRAL_PASSWORD,
      extension: RINGCENTRAL_EXTENSION
      })
      .then(function(resp) {
          read_user_info
      });

function read_user_info(){
    platform.get('/account/~/extension')
        .then(function (resp) {
          var jsonObj = resp.json()
          for (var record of jsonObj.records){
            console.log(JSON.stringify(record))
            console.log("======")
          }
        })
        .catch(function(e){
          console.log(e.message)
        });
}


1 |1500 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.

Anirban avatar image
Anirban answered

You can use Get Extension List API to get all the extension details in an array of record:

Check the doc here: https://developers.ringcentral.com/api-reference/Extensions/listExtensions

So if you use GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension API

all the extension will be in array of record.

If you want to filter any particular extension details use: https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/{ extension id}

use extension id at the end, it will filter all the details of particular extension


1 |1500 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.

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