Solved

Error sending SMS from non-main number

  • 8 November 2023
  • 3 replies
  • 132 views

We have been able to successfully send an SMS from the main number by using the admin user's JWT token and getting an access_token; however, when we try to send an SMS from a different number, we are getting the following error:

{ "errorCode": "FeatureNotAvailable", "message": "The requested feature is not available", "errors": [ { "errorCode": "MSG-242", "message": "The requested feature is not available" } ]}


the request looks like this for the main number:

curl --request POST --url 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms' --header 'accept: application/json' --header 'authorization: Bearer <redacted>' --header 'content-type: application/json' --data '{"from":{"phoneNumber":"13234714206"},"to":[{"phoneNumber":"4695859521"}],"text":"test"}'

and for the other number

curl --request POST --url 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms' --header 'accept: application/json' --header 'authorization: Bearer <redacted>' --header 'content-type: application/json' --data '{"from":{"phoneNumber":"13234714206"},"to":[{"phoneNumber":"4695859521"}],"text":"test"}'

Do we need to do something to enable sending SMS from the other number (13234714206)?

icon

Best answer by Phong1426275020 8 November 2023, 18:25

View original

3 replies

Userlevel 1

Does the admin user (the one that owns the JWT token) owns the "other" phone number? If not, then he/she cannot send SMS message from that phone number.

Check the dev guide to learn more about the rules and sample code to detect user's own numbers.

If the user owns the phone number but the number does not have SMS feature, then submit a customer support ticket to provision the number.

What is the best way to programmatically get a JWT token for another user? That is, if I have the admin user's JWT token, is there a way to create and/or obtain a JWT token for another user?

Userlevel 1

Unfortunately, there is no way for a super admin to generate a JWT token for other extensions. We are considering to support that in the future though.

So, the only option is to ask a user to login the RingCentral developers portal to generate a JWT token.

Reply