-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsend-sms.php
More file actions
28 lines (21 loc) · 829 Bytes
/
Copy pathsend-sms.php
File metadata and controls
28 lines (21 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
use Symfony\Component\Dotenv\Dotenv;
require('vendor/autoload.php');
$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env');
$rcsdk = new RingCentral\SDK\SDK(getenv('RINGCENTRAL_CLIENT_ID'),
getenv('RINGCENTRAL_CLIENT_SECRET'),
getenv('RINGCENTRAL_SERVER_URL'));
$platform = $rcsdk->platform();
$platform->login( getenv('RINGCENTRAL_USERNAME'),
getenv('RINGCENTRAL_EXTENSION'),
getenv('RINGCENTRAL_PASSWORD'));
$r = $platform->post('/account/~/extension/~/sms', array(
'from' => array('phoneNumber' => getenv('RINGCENTRAL_USERNAME')),
'to' => array(
array('phoneNumber' => getenv('RINGCENTRAL_RECEIVER')),
),
'text' => 'Message content',
));
print("Message ID: " . $r->json()->id . "\n");
?>