question

brian-ladouceur5004 avatar image
brian-ladouceur5004 asked Anirban answered

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..

sdk
1 |3000

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 Brian,

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 the developer support team or by submitting a support ticket and we shall take a look at it.

1 |3000

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

vyshakhbabji avatar image
vyshakhbabji Deactivated 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: 


1 |3000

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

Anirban avatar image
Anirban 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

1 |3000

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

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys