© 1999-2024 RingCentral, Inc. All rights reserved.
Privacy Notice
I am getting the following error when trying to send an SMS from a phone number assigned to a different user in my account. The error message makes mention of the "OutboundSMS" permission, but I do not see that permission in my account. Here is the error I am getting from the API:
{
"errorCode": "FeatureNotAvailable",
"message": "In order to call this API endpoint for another extension, one
of the following permissions [OutboundSMS] have to be granted
extended scope to the authorised user.",
"errors": [
{
"errorCode": "CMN-419",
"message": "In order to call this API endpoint for another extension,
one of the following permissions [OutboundSMS] have
to be granted extended scope to the authorised user.",
"permissionsName": "OutboundSMS"
}
],
"permissionsName": "OutboundSMS"
}
{
"errorCode": "FeatureNotAvailable",
"message": "In order to call this API endpoint for another extension, one
of the following permissions [OutboundSMS] have to be granted
extended scope to the authorised user.",
"errors": [
{
"errorCode": "CMN-419",
"message": "In order to call this API endpoint for another extension,
one of the following permissions [OutboundSMS] have
to be granted extended scope to the authorised user.",
"permissionsName": "OutboundSMS"
}
],
"permissionsName": "OutboundSMS"
}
Page 1 / 1
You are right. The error is indeed misleading because as you pointed out, that permission does exist in a way that you can assign to an extension or an app.
RingCentral only permits users to send SMS from phone numbers that are directly assigned to them. So there is no way currently that a user or admin can arbitrarily send an SMS on behalf of any other user.
But there are workarounds to this limitation. They key ultimately rests in being able to authenticate to the platform using the credentials of a person who is assigned a phone number you want to send SMS from. To do this, identify the phone number you want to send SMS from, and see who that phone number is assigned to. Let's say this person is named Andre.
As a Developer Admin, one can log into the Developer Console and generate a JWT credential on behalf of another user in the account. So ask Andre to login to the Developer Console so that they has an account there. Then have them [generate a JWT credential][1], or have the Developer Admin generate one on their behalf.
Finally, use that JWT credential to authenticate to the API. Within the context of that session, an application can then send an SMS on behalf of the phone number assigned to Andre.
There is one small exception to this rule, and it relates to [sending SMS from the Main Company Number][2]. If this is your use case, then the person in the org assigned the role of "Auto Receptionist" can send SMS from the Main Company Number, in addition to the person to whom the Main Company Number may be assigned.
[1]: https://developers.ringcentral.com/guide/getting-started/create-credential
[2]: https://community.ringcentral.com/questions/108940/how-do-i-send-an-sms-from-the-main-company-number.html
RingCentral only permits users to send SMS from phone numbers that are directly assigned to them. So there is no way currently that a user or admin can arbitrarily send an SMS on behalf of any other user.
But there are workarounds to this limitation. They key ultimately rests in being able to authenticate to the platform using the credentials of a person who is assigned a phone number you want to send SMS from. To do this, identify the phone number you want to send SMS from, and see who that phone number is assigned to. Let's say this person is named Andre.
As a Developer Admin, one can log into the Developer Console and generate a JWT credential on behalf of another user in the account. So ask Andre to login to the Developer Console so that they has an account there. Then have them [generate a JWT credential][1], or have the Developer Admin generate one on their behalf.
Finally, use that JWT credential to authenticate to the API. Within the context of that session, an application can then send an SMS on behalf of the phone number assigned to Andre.
There is one small exception to this rule, and it relates to [sending SMS from the Main Company Number][2]. If this is your use case, then the person in the org assigned the role of "Auto Receptionist" can send SMS from the Main Company Number, in addition to the person to whom the Main Company Number may be assigned.
[1]: https://developers.ringcentral.com/guide/getting-started/create-credential
[2]: https://community.ringcentral.com/questions/108940/how-do-i-send-an-sms-from-the-main-company-number.html
{ "errorCode": "FeatureNotAvailable", "message": "Phone number doesn't belong to extension", "errors": " { "errorCode": "MSG-304", "message": "Phone number doesn't belong to extension" } ]}
{ "errorCode": "FeatureNotAvailable", "message": "Phone number doesn't belong to extension", "errors": " { "errorCode": "MSG-304", "message": "Phone number doesn't belong to extension" } ]}
How did you try? It’s still the case that only the owner of a phone number can send SMS messages from that number.
You must either ask the user to generate its JWT token or if you are a super admin, you can generate a JWT token for other users. Then use that JWT token to send SMS. You should detect if the token and the number are correct. See this dev guide article.
I’ve read a few of your Medium articles and blog replies and was hoping this wouldn’t be the case (with the JWT tokens). I’m attempting to create a program that automatically filters TPS (telephone preference service) numbers and ends the calls of users making those calls. The problem is with ending the calls of course because I am using a websocket to get the telephone session id’s and parsing the relevant data from the notifications, however I can’t then use the platform.delete(f"/restapi/v1.0/account/~/telephony/sessions/{call_data{'session_id']}") to end the calls of others. This is naturally massively annoying, and I don’t want to have to generate a JWT token for every single person, it seems like really poor design that a super admin can’t control users in their organisations calls. And by the way, we use the app, not specific devices, so I can’t use device ID’s, at least not as far as I am aware anyway. The question is why it would be designed like this, because clearly the capability is there given that in the app a group admin can end the calls of other users no problem.
I’ve read a few of your Medium articles and blog replies and was hoping this wouldn’t be the case (with the JWT tokens). I’m attempting to create a program that automatically filters TPS (telephone preference service) numbers and ends the calls of users making those calls. The problem is with ending the calls of course because I am using a websocket to get the telephone session id’s and parsing the relevant data from the notifications, however I can’t then use the platform.delete(f"/restapi/v1.0/account/~/telephony/sessions/{call_data{'session_id']}") to end the calls of others. This is naturally massively annoying, and I don’t want to have to generate a JWT token for every single person, it seems like really poor design that a super admin can’t control users in their organisations calls. And by the way, we use the app, not specific devices, so I can’t use device ID’s, at least not as far as I am aware anyway. The question is why it would be designed like this, because clearly the capability is there given that in the app a group admin can end the calls of other users no problem.
Please don’t ride on an old thread to ask a different topic. This will trigger an email notification to all members who are involved in the existing discussion.
There is a solution for your use case, please create a new question and I will give the answer. Thanks for your collaboration!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.