Skip to main content
New Participant
April 1, 2024
Question

having issue when trying to send sms using jwt token

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 reply

PhongVu
Community Manager
Community Manager
April 1, 2024

Please read this post and submit a dev support ticket.