Question
SMS - error: phone number doesn't belong to extension
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.