File: /home/imensosw/www/imenso.co/payment/sms/index1.php
<?php
require('vendor/autoload.php');
$RECIPIENT = '+12055305938';
$RINGCENTRAL_CLIENTID = 'aobzKv4CTT2r7qB54kWNGQ';
$RINGCENTRAL_CLIENTSECRET = 'lfEOWd8FRZ22SfvBWpvt0gQBc-CsT1TLCHGo659pVXtQ';
$RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com';
//https://platform.devtest.ringcentral.com
$RINGCENTRAL_USERNAME = '+12055305938';
$RINGCENTRAL_PASSWORD = 'admin@123';
$RINGCENTRAL_EXTENSION = '101';
$rcsdk = new RingCentral\SDK\SDK($RINGCENTRAL_CLIENTID, $RINGCENTRAL_CLIENTSECRET, $RINGCENTRAL_SERVER);
$platform = $rcsdk->platform();
$platform->login($RINGCENTRAL_USERNAME, $RINGCENTRAL_EXTENSION, $RINGCENTRAL_PASSWORD);
$date = date('Y-m-d H:i:s');
$resp = $platform->post('/restapi/v1.0/account/~/extension/~/sms',
array(
'from' => array ('phoneNumber' => $RINGCENTRAL_USERNAME),
'to' => array(array('phoneNumber' => $RECIPIENT)),
'text' => 'Test sms from PRC '.$date
));
print_r ("SMS sent. Message status: " . $resp->json()->messageStatus);