Skip to main content

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.

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.



Reply