question

nicholas-st-gabriel14243 avatar image
nicholas-st-gabriel14243 asked ·

ringout fromNumber different callerID

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?


General Topic
1 |1500 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.

Phong Vu avatar image
Phong Vu answered ·
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
1 |1500 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.

nicholas-st-gabriel14243 avatar image
nicholas-st-gabriel14243 answered ·
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
1 comment
1 |1500 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.

Can you share some code? I just tested on my site and everything works well.
0 Likes 0 ·
nicholas-st-gabriel14243 avatar image
nicholas-st-gabriel14243 answered ·
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.
9 comments
1 |1500 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.

Sorry for ignoring the fact that one callerId works while another does not work.

Can you login https://service.devtest.ringcentral.com, select the Users tab and on the user list, click the "101" extension and select the "Outbound Calls/Faxes".

Click the edit button next to the "RingOut from Web" and select a direct number from the list. Save the change and try again.


0 Likes 0 ·
I've attached a screenshot.

Originally this was marked as the 'Main Number' line (I've erased the number from the screenshot, but it is there in the system).

So it was working with arbitrary 'from' numbers as long as they matched the 'callerID' numbers with the 'Main Number' setting.

I changed it to 'Current Location', just to try it and it continued to exhibit the same behavior, including returning Forbidden status when 'callerID' does not match the 'from' number.

Is it possible to set it up so the api will display, say a regional office's phone number but will call 'from' a random number so the person 'placing' the call can be in a different office, etc?

0 Likes 0 ·
I don't see other numbers than the main number and the current location. Look at mine dashboard where I have multiple numbers.

However, what is selected from the list is just specifying the default callerId, and any number listed on the list should be valid as a callerId for that extension.

0 Likes 0 ·
Can you point me to where to add my existing numbers to that list? I don't see any way to do it.
0 Likes 0 ·
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.


0 Likes 0 ·
Show more comments

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.