Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Latest commit

 

History

History
47 lines (32 loc) · 3.76 KB

README.md

File metadata and controls

47 lines (32 loc) · 3.76 KB

RingCentral Developer Platform

RingCentral Subscription Basic Demo App

This is a demo application showing how to use RingCentral Push Notifications using the JS SDK. This application will GET all the Extensions (Enabled + User) in your RingCentral account (based on the environment, but defaults to Sandbox) and will add eventFilters in a single Subscription that will then receive Presence Events for these Extensions. The data from these presence events is then logged in the console of the application for you to review, and if you choose, filter and then execute external REST requests using the embedded HTTP server.

This is only a demo application to show how to use Subscriptions properly with the RingCentral-JS SDK. This code should not be used directly in production, but can be used for PoC development and testing.

You are able to configure this application to operate with either your RingCentral Sandbox or Production applications in the .env file by setting the RC_ENV value to either sandbox or production.

You can also set this application to use any of the RingCentral Subscription Notification Types (they are all enabled by default) in the .env file. Read the API Reference for Notification Event Types to understand more about these options.

Prerequisites

Deploy

Local Setup

  1. Clone git clone https://github.com/bdeanindy/ringcentral-subscription-basics this repository and cd ringcentral-subscription-basics into the project directory
  2. Install the dependencies npm install
  3. Configure your environment cp .env.tmpl .env
  4. Open the .env file and copy/paste your API keys and user credentials (admin user) into this file, then save/close it.
  5. Create an application in RingCentral Developer Portal with the following parameters:
    • Platform Type: Server-only (No UI)
    • Application Type: Private
    • Permissions Needed: Read Accounts, Read Call Log, Read Presence
    • Name/Description: What you choose, but I always use something easy to identify in lists

Operation

  1. To start the application, npm start
  2. When you see "Subscription created successfully", you're ready to create a presence event to test
  3. Call one of the numbers you have subscribed to in the application (currently this subscribes to all Enabled User extensions in your RingCentral Sandbox account) from your cellular or an outside line.
  4. You should see an incoming msg (Notification) when you dial into one of these numbers.

Troubleshooting

  1. Not seeing presence events? Uncomment the console.log() which references eventFilters and re-run the application to see what extensions are being monitored
  2. Subscription failing to setup? Have you setup extensions in your RingCentral Sandbox account? Have they been enabled to monitor for Presence events?
  3. Anything else...add an issue and I will respond as soon as I am able