Skip to main content

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 RingCentralSDKSDK($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

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





Reply