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
Can I use ~ instead of specifying concrete extension when making `Send SMS` API call on behalf of different users?
Tags: sms and text messaging, rest api, sending sms
Mar 9, 2023 at 11:45pm   •   1 replies  •  0 likes
Vadym Polishchuk

Let's say I have a RingCentral account with 10 users with different extensions and one admin user. Admin user logins into my app and provides credentials (access/refresh tokens). After that I can use ~ instead of `extension` when making API calls to, let's say, get list of all phone numbers of the account. But If I want to send SMS using API from some user (out of those 10), do I have to get their extension id and specify it in the url when making API call, or can I just use ~ instead? It's important, that the caller ID of this user is shown to the person who I intend to send message to.

1 Answer
answered on Mar 10, 2023 at 7:33am  

No you cannot. You cannot send SMS on behalf of the owner of the phone number. In other words, you can only send SMS messages from your own phone number, even if you are a super admin user.

The tilde ~ at the /extensionId/ represents the extension id of the user who calls that API. The server recognize the extension id using the access token that is used to call the API.

To send SMS messages on behalf of other user extensions, you must implement your app to allow each of the users logins your app (at lease once), then you will keep the access token (valid max. 1 hr) and the refresh token (valid max. 7 days) of that user securely in your server (db). You will need to handle auto refresh to make sure that the refresh token will be always valid. Every time you refresh the token, a new access token and new refresh token will be issued and you have to replace the old tokens in your db.

When your app sends SMS on behalf of a user, check if that user has logged in and if the access token is still valid, use the access token to send the SMS message. If the access token expired, use the refresh token to get a new access token and use the new access token to send the SMS message. Remember to save the new tokens in your db.



 0



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