Skip to content

Commit

Permalink
Merge pull request #33 from anilkumarbp/master
Browse files Browse the repository at this point in the history
Demo to use _credentials.php file
  • Loading branch information
kirill-konshin authored Jun 17, 2016
2 parents 3b98b29 + 19cb1e9 commit 69ba771
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 41 deletions.
12 changes: 0 additions & 12 deletions demo/_credentialsSample.json

This file was deleted.

10 changes: 10 additions & 0 deletions demo/_credentialsSample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return array(
'username' => '18881112233', // your RingCentral account phone number
'extension' => null, // or number
'password' => 'yourPassword',
'appKey' => 'yourAppKey',
'appSecret' => 'yourAppSecret',
'server' => 'https: //platform.devtest.ringcentral.com', // for production - https://platform.ringcentral.com
'smsNumber' => '18882223344', // any of SMS-enabled numbers on your RingCentral account
'mobileNumber' => '16501112233', // your own mobile number to which script will send sms
);
6 changes: 2 additions & 4 deletions demo/authData.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/callRecording.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/errorHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
use RingCentral\SDK\Http\ApiException;
use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
3 changes: 2 additions & 1 deletion demo/fax.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

use RingCentral\SDK\SDK;

$credentials = require(__DIR__ . '/_credentials.php');

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/ringout.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use RingCentral\SDK\SDK;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down
6 changes: 2 additions & 4 deletions demo/subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
use RingCentral\SDK\Subscription\Events\NotificationEvent;
use RingCentral\SDK\Subscription\Subscription;

$credentials_file = count($argv) > 1
? $argv[1] : __DIR__ . '/_credentials.json';

$credentials = json_decode(file_get_contents($credentials_file), true);

// Create SDK instance

$credentials = require(__DIR__ . '/_credentials.php');

$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');

$platform = $rcsdk->platform();
Expand Down

0 comments on commit 69ba771

Please sign in to comment.