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.
- Valid RingCentral Account
- Access to RingCentral Developer Portal
- Have created a RingCentral Sandbox Account for development. Read how to do this here
- Have configured your Sandbox Account to have one or more extensions which allow presence to be monitored. Read how to setup Presence monitoring here
- Node.js installed locally
- Clone
git clone https://github.com/bdeanindy/ringcentral-subscription-basics
this repository andcd ringcentral-subscription-basics
into the project directory - Install the dependencies
npm install
- Configure your environment
cp .env.tmpl .env
- Open the
.env
file and copy/paste your API keys and user credentials (admin user) into this file, then save/close it. - 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
- To start the application,
npm start
- When you see "Subscription created successfully", you're ready to create a presence event to test
- 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.
- You should see an incoming msg (Notification) when you dial into one of these numbers.
- Not seeing presence events? Uncomment the console.log() which references
eventFilters
and re-run the application to see what extensions are being monitored - Subscription failing to setup? Have you setup extensions in your RingCentral Sandbox account? Have they been enabled to monitor for Presence events?
- Anything else...add an issue and I will respond as soon as I am able