Question

ringout fromNumber different callerID

  • 20 February 2019
  • 3 replies
  • 1060 views

I am working on an application calling the RingOut REST endpoint.


When I specify identical 'from' number and 'callerId' numbers the API functions as I expect and the calls are placed.


When I specify different 'from' number and 'callerId' numbers the API returns a 'FORBIDDEN' status.


I have narrowed the difference in the two calls to only that difference and cannot find anything specific in the documentation that points to this as an issue.


Is there a way to call the endpoint with different 'from' number and 'callerId' numbers?




3 replies

Userlevel 1
Hi Nicholas,

The caller Id must be one of the company direct numbers. If the "fromNumber" is from an extension rather than 101, the callerId can be any direct number of that extension or any direct number from the company direct numbers.

Can you double check and try again.
+ Phong
Hi There,

I have attempted it with two different numbers listed for my company's 'Direct Numbers' and it seems to make no difference.

-Nicholas
var rc = new RingCentral.RestClient(_appKey, _appSecret);
var token = rc.Authorize(_username, "101", _password).Result;
var client = new RestSharp.RestClient("https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out/");
                var jsonString = $"{{"from":{{"phoneNumber":"{fromNumber}"}},"to":{{"phoneNumber":"{toNumber}"}},"callerId":{{"phoneNumber":"{callerID}"}},"playPrompt":true,"country":{{"id":"1"}}}}";
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "Bearer " + token.access_token);
request.AddParameter("application/json", jsonString, ParameterType.RequestBody);
var response = client.Execute(request);
I've hardcoded a couple a values here trying to make this work.  Like I said, if 'fromNumber' equals 'callerId' everything works fine, if I make them different then response.StatusCode == Forbidden.

Reply