ringout fromNumber different callerID

  • 1
  • Question
  • Updated 4 weeks ago
  • (Edited)
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?


Photo of Nicholas St. Gabriel

Posted 4 weeks ago

  • 1
Photo of Phong Vu

Phong Vu, Devangelist

  • 4,566 Points 4k badge 2x thumb
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
Photo of Phong Vu

Phong Vu, Devangelist

  • 4,356 Points 4k badge 2x thumb
Can you share some code? I just tested on my site and everything works well.
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.
Photo of Phong Vu

Phong Vu, Devangelist

  • 4,356 Points 4k badge 2x thumb
Under the same page you select the "Ext. 101" tab and click the Phones & Numbers. Choose the "Numbers" tab and click "Add Direct Number" then follow the instruction to add a number.

I attempted that and assumed, but was unable to add numbers from my account or add new numbers.

The only options is the 'Add Direct Number' and there is no way to complete the form.

Photo of Phong Vu

Phong Vu, Devangelist

  • 4,356 Points 4k badge 2x thumb
Most of the states have no more available numbers. Try several different states or choose some state from Canada.
That seems to have resolved the issue, but I want to clarify that there is no way to use our existing numbers from our production system in the development environment to do testing?
Photo of Phong Vu

Phong Vu, Devangelist

  • 4,356 Points 4k badge 2x thumb
Well, absolutely you cannot use numbers from your production environment in your sandbox environment.