News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
SMS - error: phone number doesn't belong to extension
Tags: rest api
Jun 23, 2020 at 8:39am   •   1 replies  •  0 likes
Lucas Heneks

Hello,

We are trying to use the javascript sdk to send SMS messages.

We use the main extension to login to the sdk, and pass a users RingCentral number as the from parameter. We receive the error "error: phone number doesn't belong to extension" as a response.


Here is some code we are using to test.


async function send() {
    const sdk = new SDK(config.ringCentral)
    await sdk.platform().login({
        username: config.ringCentral.user,
        extension: config.ringCentral.mainExt,
        password: config.ringCentral.pw
    })

    const message = {
        from: { phoneNumber: '1<Ring Central number>' },
        to: [{ phoneNumber: '1<my cell number>' }],
        text: 'this is a test message'
    }

    const res = await sdk.platform().post('/restapi/v1.0/account/~/extension/~/sms', message)
    console.log(res.data)
}


Any assistance you can provide is appreciated.



1 Answer
answered on Jun 23, 2020 at 10:36am  

The error is self explanatory. It indicate that the phone Number does not belong to the extension (or user) who logged in to run the application. You need to use the direct number assigned to that user (extension).


 0
on Jun 16, 2022 at 7:04am   •  0 likes

Hi . Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us