Create a Dial group - Python Quick Start

Last updated: 2020-05-29 Contributors Paco Vu

Welcome to the Engage Voice 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 Engage Voice 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 Engage Voice App

  1. Login or create an account if you have not done so already.
  2. Go to Console/Apps and click 'Create App' button.
  3. Give your app a name and description, then click Next.
  4. On the second page of the create app wizard enter the following:
    • Select 'Private' for Application Type.
    • Select 'Server-only (No UI)' for Platform Type.
  5. On the third page of the create app wizard, select the following permissions:
    • ReadAccounts
  6. We are using Password Flow authentication, so leave "OAuth Redirect URI" blank.

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.

Install Engage Voice SDK Wrapper for Python

$ pip install engagevoice-sdk-wrapper

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.

from engagevoice.sdk_wrapper import *

RINGCENTRAL_CLIENTID = '<ENTER CLIENT ID>'
RINGCENTRAL_CLIENTSECRET = '<ENTER CLIENT SECRET>'

RINGCENTRAL_USERNAME = '<YOUR ACCOUNT PHONE NUMBER>'
RINGCENTRAL_PASSWORD = '<YOUR ACCOUNT PASSWORD>'
RINGCENTRAL_EXTENSION = '<YOUR EXTENSION>'

def create_a_dial_group():
    try:
        endpoint = 'admin/accounts/~/dialGroups'
        params = {
          "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)     
    except Exception as e:
        print (e)

ev = RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET)
try:
    resp = ev.login(RINGCENTRAL_USERNAME, RINGCENTRAL_PASSWORD, RINGCENTRAL_EXTENSION)
    if resp:
        create_a_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!

Search the forums »

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 Engage Voice application.