question

brian-ladouceur avatar image
brian-ladouceur asked ·

How to test Send SMS API in Sandbox testing.?

We have created an application on developer account.

our application is under Sandbox..
we are facing issue at the API explore to test the callback and responses.

But still not get success in this due to some exception coming from API.

URL:  https://developer.ringcentral.com/api-explorer/latest/index.html#/!/Messages/sendSMS

Using from number : +19045591097
To number : +14804523757
and Message Text: Hello good morning.

Getting error as below

{
"errorCode": "InvalidParameter",
"message": "Parameter [toNumber] value is invalid", "errors": [ { "errorCode": "CMN-101", "message": "Parameter [toNumber] value is invalid", "parameterName": "toNumber" } ], "parameterName": "toNumber" }

Number format is OK.

What exact error or issue not getting from body response..
topic-default
1 |1000 characters needed characters left characters exceeded

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

ak avatar image
ak answered ·
Hi Brain,

Could you please provide us the API request? 

Just as a reference, the request body when you send the SMS should be as below:

{
                 
"to": [{"phoneNumber": "To Number"}], // Should be an array
"from": {"phoneNumber": "From Number << Sandbox NUmber >>"},
"text": "Test SMS message from Platform server"
}
Could you please try again and confirm if it works.
                

If you still have problems sending the SMS using the sandbox number, please open a case by emailing the API request and response to devsupport@ringcentral.com and we shall take a look at it.
Share
1 |1000 characters needed characters left characters exceeded

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

vb avatar image
vb answered ·
Hi, Please make sure you click on Add Item under to number for the body of SMS in API explorer before sending the sms. Can you please send us the full Response from the console log if the test fails? 

PFA screenshot: 


Share
1 |1000 characters needed characters left characters exceeded

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

Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

This is how it should be :

API url: https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms

API method: POST


Body:

{"from":{"phoneNumber":"<your phone From number>"},"to":[{"phoneNumber":"<your To phone number>"},{"phoneNumber":"<your To phone number>"}],"text":"Test sms test"}

Just remember, To parameter is an array.

You need to first test your app in API explorer where you will get the request body generated

Share
1 |1000 characters needed characters left characters exceeded

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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