RingCX Dial Group Quick Start
Welcome to the RingCX Platform. In this Quick Start, we are going to create a predictive dial group for an account. Let's get started.
Create an App
The first thing we need to do is create an app in the RingCentral Developer Portal. This can be done quickly by clicking the "Create App" button below. Just click the button, enter a name and description if you choose, and click the "Create" button. If you do not yet have a RingCentral account, you will be prompted to create one.
Create App Show detailed instructions
- Login or create an account if you have not done so already.
- Go to Console/Apps and click 'Create App' button.
- Select "REST API App" under "What type of app are you creating?" Click "Next."
- Under "Auth" select "JWT auth flow"
- Under "Security" add the following permissions:
- SMS
- ReadAccounts
- Under "Security" select "This app is private and will only be callable using credentials from the same RingCentral account."
When you are done, you will be taken to the app's dashboard. Make note of the Client ID and Client Secret. We will be using those momentarily.
Create a Dial Group for an RingCX Account
Install RingCX SDK Wrapper for Node JS
$ npm install ringcentral-engage-voice-client
Create and Edit create-dial-group.js
Create a file called create-dial-group.js. Be sure to edit the variables in ALL CAPS with your app and user credentials.
const EngageVoice = require('ringcentral-engage-voice-client').default
const path = require('path')
// Remember to modify the path to where you saved your .env file!
require('dotenv').config({ path: path.resolve(__dirname, '../.env') })
const RunRequest = async function () {
const EngageVoice = require('ringcentral-engage-voice-client').default
// Instantiate the SDK wrapper object with your RingCentral app credentials
const ev = new EngageVoice({
clientId: process.env.RC_CLIENT_ID,
clientSecret: process.env.RC_CLIENT_SECRET
})
try {
// Authorize with your RingCentral Office user credentials
await ev.authorize({ jwt: process.env.RC_JWT })
// Create a new Dial Group
const postBody = {
"dialGroupName": "My New Dial Group",
"dialGroupDesc": "A test dial group with predictive dial mode",
"dialMode": "PREDICTIVE",
"isActive": true
}
const response = await ev.post('/api/v1/admin/accounts/{accountId}/dialGroups', postBody)
console.log(response);
}
catch (err) {
console.log(err.message)
}
}
RunRequest();
Run Your Code
You are almost done. Now run your script.
$ node create-dial-group.js
Install RingCX SDK Wrapper for PHP
$ composer require engagevoice-sdk-wrapper
Create and Edit create-dial-group.php
Create a file called create-dial-group.php. Be sure to edit the variables in ALL CAPS with your app and user credentials.
<?php
require('vendor/autoload.php');
$ev = new EngageVoiceSDKWrapper\RestClient(
$_ENV['RC_CLIENT_ID'],
$_ENV['RC_CLIENT_SECRET']
);
try{
$ev->login( [ "jwt" => $_ENV['RC_JWT'] ], function($response){
create_a_dial_group();
});
}catch (Exception $e) {
print $e->getMessage();
}
function create_a_dial_group(){
global $ev;
try{
$endpoint = 'admin/accounts/~/dialGroups';
$params = array (
"dialGroupName" => "My Dial Group - Predictive",
"dialGroupDesc" => "A test dial group with predictive dial mode",
"dialMode" => "PREDICTIVE",
"isActive" => true
);
$response = $ev->post($endpoint, $params);
print ($response."\r\n");
}catch (Exception $e) {
print $e->getMessage();
}
}
?>
Run Your Code
You are almost done. Now run your script.
$ php create-dial-group.php
Install RingCX SDK Wrapper for Python
$ pip install ringcentral_engage_voice
Create and Edit create-dial-group.py
Create a file called create-dial-group.py. Be sure to edit the variables in ALL CAPS with your app and user credentials.
import os, sys, time
from dotenv import load_dotenv
from ringcentral_engage_voice import RingCentralEngageVoice
load_dotenv()
def create_dial_group():
try:
postBody = {
"dialGroupName": "My New Dial Group",
"dialGroupDesc": "A test dial group with predictive dial mode",
"dialMode": "PREDICTIVE",
"isActive": True
}
response = ev.post("/api/v1/admin/accounts/{accountId}/dialGroups", postBody).json()
print(response)
except Exception as e:
print(e)
# Instantiate the SDK wrapper object with your RingCentral app credentials
ev = RingCentralEngageVoice(
os.environ.get('RC_CLIENT_ID'),
os.environ.get('RC_CLIENT_SECRET')
)
try:
# Authorize with your RingCentral Office user credentials
ev.authorize(
jwt=os.environ.get('RC_JWT')
)
create_dial_group()
except Exception as e:
print(e)
Run Your Code
You are almost done. Now run your script.
$ python create-dial-group.py
Need Help?
Having difficulty? Feeling frustrated? Receiving an error you don't understand? Our community is here to help and may already have found an answer. Search our community forums, and if you don't find an answer please ask!
What's Next?
When you have successfully made your first API call, it is time to take your next step towards building a more robust RingCX application.