Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RingCentral, { SERVER_SANDBOX } from ‘ringcentral-ts’;
- let rc = new RingCentral({
- server: SERVER_SANDBOX, // You should use SERVER_PRODUCTION in production
- appKey: ‘{yourAppKey}’,
- appSecret: ‘{yourAppSecret}’
- });
- // Log into RingCentral
- rc.auth({
- username: ‘{username}’,
- extension: ‘{extension}’,
- password: ‘{password}’
- }).then(() => {
- console.log(‘login success’);
- return rc.account().get(); // Call RingCentral REST API
- }).then(accountInfo => {
- console.log(“Current account info”, accountInfo);
- return rc.logout(); // Logout
- }).then(() => {
- console.log(“logout success”);
- }).catch(e => {
- console.error(‘Error occured’, e);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement