question

James Pee avatar image
James Pee asked Phong Vu commented

Error sending SMS from non-main number

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)?

sms and text messagingsending sms
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

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.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

James Pee avatar image
James Pee answered Phong Vu commented

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?

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

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.

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys