News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
having issue when trying to send sms using jwt token
Tags: authentication, sending sms
Apr 1, 2024 at 1:14am   •   1 replies  •  0 likes
siva rama krishna kumar

iam trying to test sms call via code got this error

# POST BODY
body = {
  
"from": {
  
"phoneNumber": "+1929415xxxx"
},
"to": [
{
  
"phoneNumber": "+1929378xxxx"
}
],
"text": "test api call",
}


rcsdk = SDK(RC_CLIENT_ID,RC_CLIENT_SECRET,RC_SERVER_URL)
platform = rcsdk.platform()
try:
# Assuming platform.login() logs in using the token
platform.login(jwt=jwt_token)
# Assuming you have a 'body' variable defined elsewhere
response = platform.post('/restapi/v1.0/account/~/extension/~/sms', body)
data=json.loads(response.text())
print("Request successful.",data)
# Check response status for success
api_response_status = response.json().messageStatus
if api_response_status == "Received" or "Queued":
print('SMS sent successfully!',api_response_status)
else:
print(f'Failed to send SMS. Status: {response.json().messageStatus}')


except Exception as e:
print(f"Error occurred while processing token {e}")
got this error:Error occurred while processing token The requested feature is not available
then tried from api reference ui
got this error
{ "errorCode": "FeatureNotAvailable", "message": "The requested feature is not available", "errors": [ { "errorCode": "MSG-242", "message": "The requested feature is not available" } ] }
looked though few post here in many mention to check account type
/restapi/v1.0/account/accountId/phone-number:
{
  
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/338914004/phone-number/373220004"
"id":373220004
"phoneNumber":"+1929415xxxx"
"paymentType":"Local"
"location":"New York City, NY"
"type":"VoiceFax"
"usageType":"MainCompanyNumber"
"status":"Normal"
"primary":false
}
1 Answer
answered on Apr 1, 2024 at 7:23am  

Please read this post and submit a dev support ticket.


 0



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us