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