I'm trying to test out different API functionality before beginning to build an application to link a client's CRM to the Ring Central API.
I've gone through the "Getting Started" tutorial, and have successfully retrieved an access token and logged in.
I'm going through the "Message" tutorial, and I'm trying to send a POST request to send a test message. I couldn't figure out how to format the JSON correctly in the Rest Client chrome extension, so I'm replicating the POST message in the "Message" tutorial in a curl request. Here's the request I'm running from the command line (the fields in all caps are filled in with the correct values):
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer MY-ACCESS-TOKEN" -H "Accept: application/json" -d '{"to": [{"phoneNumber": "PERSONAL-PHONE-NUMBER"}], "from": {"phoneNumber": "SANDBOX-ACCOUNT-NUMBER"}, "text": "this is the message"}' https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms
And here's the response I'm getting:
{ "errorCode" : "FeatureNotAvailable", "message" : "The requested feature is not available", "errors" : [ { "errorCode" : "MSG-242", "message" : "The requested feature is not available" } ]
}
Any Idea what might be going wrong?
You are trying to use the main company number for the Sandbox account (you cannot send SMS from that number). What you want to do is create a new user on https://service.devtest.ringcentral.com and then...
Go to the Phones & Numbers section (URI below), add a direct number and add a phone for the user from the previous step. Also, please make sure that you have activated the user account, you can see this in the user so you can see they are enabled on the list of users.
Here is a screenshot of an account that I am able to use while sending SMS.
Please complete these steps and try again and you should be able to send the SMS from the soft phone (when you're logged in as that user in the soft phone or via the API as the newly created user and using their number as the "from" number in your API request).
Let me know.
via curl-
My API call:
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer VALID_AUTH_TOKEN" -d "{\"from\":{\"extensionNumber\":\"\",\"location\":\"\",\"name\":\"\",\"phoneNumber\":\"SANDBOX_PHONE_NUMBER\"},\"to\":[{\"extensionNumber\":\"\",\"location\":\"\",\"name\":\"\",\"phoneNumber\":\"EXTERNAL_PHONE_NUMBER\"}],\"text\":\"This is my API Explorer SMS message.\"}" "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms";
And here's the response I'm getting:
{
"errorCode" : "FeatureNotAvailable",
"message" : "The requested feature is not available",
"errors" : [ {
"errorCode" : "MSG-242",
"message" : "The requested feature is not available"
}
I get the same response whether I'm using -H or --header for my header flag.
via API explorer-
and here's the response:
soft phone's response-
Here's the permissions page
Note- If I'm logged into soft phone with the non-sandbox account, I can send external text messages without any issue. Do I need to toggle anything from within my https://service.devtest.ringcentral.com account or the https://service.ringcentral.com account?
My apologies if this is overkill, I just figure that more info might be helpful!
I just tried this from my console successfully, using this cURL request (after obtaining a valid access_token):
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer REPLACE_WITH_ACCESS_TOKEN" -d "{\"from\":{\"extensionNumber\":\"\",\"location\":\"\",\"name\":\"\",\"phoneNumber\":\"16506429233\"},\"to\":[{\"extensionNumber\":\"\",\"location\":\"\",\"name\":\"\",\"phoneNumber\":\"14158905908\"}],\"text\":\"This is my API Explorer SMS message.\"}" "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms";I'm using:
curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.37.1 SecureTransport zlib/1.2.5
I kept receiving Unsupported Media Type errors when I was using the -H flag for headers instead of --headers.
You can use our API Explorer for sending test SMS messages via the API as well. Could you try it in the API Explorer and share the response please sir.
https://developers.ringcentral.com/api-explorer/latest/index.html#/!/Messages/sendSMS
"Alert: Your extension does not support external text messaging. Please contact your account administrator."
Is there any way to enable some sort of stubbed external texting in Sandbox? If not, how should I go about testing my application's texting feature?
If you are sure that User/Extension has been enabled, is the account authorized to send SMS? A good test for this is to try sending an SMS from the Desktop soft phone in Sandbox mode.
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