question

Jai B avatar image
Jai B asked Velmurugan B edited

Need to change from Phone number while calling Ring-Out API

I am using ring central API to make a call. I want to change from phone number while calling using API. I am passing fromPhoneNumber in array, But it still showing default CallerID CNAM to recipient.

Code:

$rcsdk = new RingCentral\SDK\SDK($credentials['clientId'], $credentials['clientSecret'], $credentials['server']);

$platform = $rcsdk->platform();

$platform->login($credentials['username'], $credentials['extension'], $credentials['password']);

$resp = $platform->post("/account/~/extension/~/ring-out",

array(

'from' => array('phoneNumber' => '+1xxxxxxxxxx'),

'to' => array('phoneNumber' => $RECIPIENT),

'playPrompt' => false

));

Is there a way so I can alter this code and display a different number for a caller?

Thanks in advance

rest api
1 |3000

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

1 Answer

vyshakhbabji avatar image
vyshakhbabji Deactivated answered Velmurugan B edited

You can either pass callerId that can be associated to your logged in extension via callerID param of ring out api or set callerID using the callerID api as specified below:

POST /restapi/v1.0/account/1133926004/extension/1133926004/ring-out
{
    "from": {"phoneNumber": "+12053320032"},
    "to": {"phoneNumber": "+16052160005"},
    "playPrompt": true,
    "callerId":{"phoneNumber":"XXXXX"}
}


Update callerID https://developers.ringcentral.com/api-reference/User-Settings/updateExtensionCallerId




2 comments
1 |3000

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

Thank you vyshakhbabji ,

Will you please tell me how I can make a ring-out call to fulfill my requirements?

I have a ring central account and in "Phone System" >> All Numbers
Company Main : +14XXXXXXX111

When I make a ring out call by API this number is shown to the recipient.

Now what I need to do.
I have two phone numbers
+14XXXXXXX222
+14XXXXXXX333
Where should I add them so I can call from them?

It means the above two numbers should show to the recipient, not the default "Company Main" number.

Thank you
0 Likes 0 ·

Hey @Jai B ,

Did you try sending the number you want to be displayed as 'callerId' in the payload like shown below?

POST /restapi/v1.0/account/1133926004/extension/1133926004/ring-out
{
    "from": {"phoneNumber": "+14XXXXXXX111"},  // Main number
    "to": {"phoneNumber": "Number_you_want_to_Call"},
    "playPrompt": true,
    "callerId":{"phoneNumber":"+14XXXXXXX222"}  // Number to be displayed
}


0 Likes 0 ·

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