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
How to send SMS via RingCentral API to other extensions
Tags: sending sms, extension, rest api
Aug 31, 2022 at 1:09am   •   1 replies  •  0 likes
Developer Access

We need to develop an application that should send SMS to several users in our company via RingCentral API.

We registered new App in "RingCentral Developers" console and granted "SMS" in "App Permission" section of App in "RingCentral Developers" console.


Our application connects to RingCentral API using Password-based auth flow

(with Extension shown in "Credentials" section of App in "RingCentral Developers" console).


But when the app tries to send SMS to a number belongs to another extension, it receives following error:

"In order to call this API endpoint for another extension, one of the following permissions [OutboundSMS] have to be granted with extended scope to the authorized user."


We investigated "RingCentral Community" in order to understand what is the cause of this error or how to avoid it.

All topics we found contain answers like following:

"You can only send SMS from phone numbers belong to the extension you currently log in".


Please clarify - how can we log in under some other extension than shown in "Credentials" section of the App?

Maybe we should register several developer accounts with different extensions?

If so, how we can specify extension of other user when we create developer account?


Or, there is some possibility to grant [OutboundSMS] permission to developer account? If so, how can we do it?




1 Answer
answered on Aug 31, 2022 at 3:27am  

Let's say you have an extension 103, which has a direct number +1 (408) 123-4567.

If you authenticate the app with the extension 103 username and password, you can send text message from the number +1 (408) 123-4567 to any other phone numbers.

To make sure that you send from a number that owned by the authenticated extension, you can call this endpoint to check its own numbers and also check if the number has the SMS feature.

The error you got is caused be sending from a number that belongs to another extension. And the error is misleading as it is not supported at all.


 1
on Aug 31, 2022 at 5:11am   •  0 likes

We use phone number and extension from "Credentials" section of App in "RingCentral Developers" console.


Yes, endpoint you provided returns a list containing this number

(we called the "phone-number" method for "~" accountId and "~" extension).


But the "features" array in this number's record contains "CallerId" value only.

Please advice how to grant "SmsSender" feature to the number?


(if it is important, the "usageType" value is "MainCompanyNumber")


on Aug 31, 2022 at 7:06am   •  0 likes

So that is the main company number and it does not belong to the user you authenticated the app.

To send message from the main company number, you have to authenticate the app with the main super admin, normally the extension 101 if the admin does not change its extension number.

on Aug 31, 2022 at 7:20am   •  0 likes

If I change extension to "101" (instead of shown in "Credentials" section of console) then I get following error during authorization:

"Invalid resource owner credentials"


Where to see extension of main super admin?


on Aug 31, 2022 at 8:20am   •  0 likes

Then you have to login with the super admin user credentials. It's your account so you should know it. Otherwise, let me know the account id so I can tell.

on Aug 31, 2022 at 9:33am   •  0 likes

our accountId is 2816950020

on Aug 31, 2022 at 9:44am   •  0 likes

The username of the main super admin user of this account is "alex.izvekov@yourcompany-domain". The extension number is 5000.

You can also try to login with this extension (Xvand Operator, Ext. 49001 to see if it is assigned the SMS feature of the main company number.

on Sep 7, 2022 at 7:45am   •  0 likes

Unfortnately when we try to send SMS from main company number, then we receive following error (even under super-admin):

Phone number doesn't belong to extension


But sending SMS from number of super-admin is successful.

At this moment, this is enough for us.

Thank you!



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