Skip to main content
The First Step
February 20, 2025
Question

I wrote a script that uses SMS perfectly and auth token works fine on my personal number. However, I can't sms out of a group number that I am part of. What do I need to check?

Pretty much as the title says.  

If my personal number is 555-555-5555 in the script, the SMS goes through.

 

I am part of a group that has the number of 999-999-9999.  If I switch to that number, it breaks permissions in the script.  

Here’s the response paste after my access token.  

SMS Response: {
  "errorCode" : "FeatureNotAvailable",
  "message" : "Phone number doesn't belong to extension",
  "errors" : [ {
    "errorCode" : "MSG-304",
    "message" : "Phone number doesn't belong to extension"
  } ]
}
Error sending SMS: Phone number doesn't belong to extension
 

    1 reply

    PhongVu
    Community Manager
    Community Manager
    February 21, 2025

    What do you mean you are part of a group? A call queue? If so, currently no one in a call queue can send receive SMS via the call queue direct phone number. It will be support in the near future though.

    All in all, to be able to send/receive SMS, a user must own the SMS feature of a phone number. See this code for how to detect the SmsSender feature.

    /*
    Read phone number(s) that belongs to the authenticated user and detect if a phone number
    has the SMS capability
    */
    async function read_extension_phone_number_detect_sms_feature(){
    try {
    let endpoint = "/restapi/v1.0/account/~/extension/~/phone-number"
    var resp = await platform.get(endpoint)
    var jsonObj = await resp.json()
    for (var record of jsonObj.records){
    for (var feature of record.features){
    if (feature == "SmsSender"){
    // If a user has multiple phone numbers, check and
    // decide which number to be used for sending
    // the SMS message. For simplicity, we pick the
    // first one we find.
    return send_sms(record.phoneNumber)
    }
    }
    }
    if (jsonObj.records.length == 0)
    console.log("This user does not own a phone number!")
    else
    console.log("None of this user's phone number(s) has the SMS capability!")
    } catch(e) {
    console.log(e.message)
    process.exit(1)
    }
    }

    https://developers.ringcentral.com/guide/messaging/quick-start