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.
- 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-basicsthis repository andcd ringcentral-subscription-basicsinto the project directory - Install the dependencies
npm install - Configure your environment
cp .env.tmpl .env - 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
- Populate your environment file with your Application and Admin user data (the keys in the
.envfile should be pretty straight forward)
- 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
eventFiltersand 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