Question

How to setup users to send SMS from Toll Free Number

  • 8 August 2019
  • 2 replies
  • 1756 views

Problem: I am logging in as my user account in production through the api and can not send an SMS from our toll free number. Which account do I need to be logged in as? Our toll free number is assigned to an IVR. We are using a multi-level IVR. I'm guessing I have to log in as the main company number, but will that work since our toll free number isn't the main company number?


I'm not super familiar with the user management system in RingCentral which may be why I'm getting turned around here. In the sandbox I'm not able to mimic our prod setup exactly because I can't add a toll free number in the sandbox but that is the number we will be sending from in prod.


2 replies

Userlevel 1

Hi Luke,

As your SMS toll free numbers belong to the account level, you need to login with an admin user (normally the 101 or main company number). Once you log in, you can read the the phone numbers and detect if a number is an SMS TollFree number or not. Here is the code snippet in Node JS

var SDK = require('ringcentral')

var rcsdk = new RC( {server: "server_url", appKey: "client_id", appSecret: "client_secret"} );
var platform = rcsdk.platform();

platform.login( {username: "username", password: "password", extension: "extension_number"} )
    .then(function(resp) {
        read_sms_tollfree_number()
    });

function read_sms_tollfree_number(){
    platform.get('/account/~/extension/~/phone-number')
      .then(function(response) {
          var jsonObj =response.json();
          for (var record of jsonObj.records
              if (record.paymentType == "TollFree") {
                  if (record.type == "VoiceFax"){
                      for (var feature of record.features){
                          if (feature == "TollFreeSmsSender"){
                              console.log("TollFree number: " + record.phoneNumber)
                          }
                      }
                  }
              }
          }
        })
        .catch(function(e)
            console.error(e.message);
        });
}

In order to run this script I will need to duplicate my app to add the ReadAccounts permission, wait 3 days until I meet the graduation requirements to get prod credentials, then run the script hopefully without needing other permissions?

Reply