I am testing RingCentral RingOut functionality and by following the docs working on it. But I am facing a few problems:
- which countries RingCentral supports to call (from and to)?
- How can I place a test call using two different cell numbers?
Currently, I am making a RingOut request but in response i'm getting 400 bad request error with message of that:
from and to ("Unrecognized token 'from': was expecting 'null)
Updated:
Sending ajax request having these params:
var url = 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ringout';
var data = {
"from": {"phoneNumber": "usa_phone_sandboxed"},/*from parameter is optional if there is a default number in user's forwarding numbers */
"to": {"phoneNumber": "usa_phone_real"}, /*to parameter is required */
/*"playPrompt": true optional field */
};
var headersArray = [
{"Content-Type": "application/json"},
{"Authorization": "Bearer "+my_access_token}
];
I'm using a sandbox account. Language: Javascript on browser side.
To solve the 400 (Bad Request) issue, the first thing you'll want to do is GET the list of Forwarding Numbers to determine if there is a default number configured in the forwarding numbers for your account. This will let you know if you need to provide the
from
object or not in your POST RingOut request.If the
totalResults === 0
anddefaultNumber is not set
for your extension's forwarding numbers, then you must provide thefrom
object in the POST body.Remember the
from.phoneNumber
will need to be your extension's direct number or one of your extension's available forwarding numbers. Theto.phoneNumber
should be the phone number for your contact.You asked the following questions as well:
Which countries RingCentral supports to call(from and to)?
This is going to depend upon your account type and extension settings. First you will want to know if the currently authenticated extension is generally able to make International Calls. This can be done using GET an Extension by Id the response body will contain a property named
serviceFeatures
, thefeatureName === InternationalCalling
is the right property to view first.For example, here is this setting in my free developer account (which means I cannot make international calls with my extension):
For comprehensive information about your account's international dialing capabilities, you will want to view the RingCentral Online Account Portal.
How I can place a test call using two different cell numbers?
Not sure I completely follow your question, do you mean using two different
to.phoneNumbers
or two differentfrom.phoneNumbers
? Could you provide more specifics about what you are trying to achieve?