Skip to content
RingCentral Connect Platform Python SDK
Python Makefile
Branch: master
Clone or download
PacoVu and kirill-konshin Support get query with parameter array
Fixed P2.7 and 3.x compatibility
Update requirements.txt
Docker files & virtual envs
Travis fix
Split test case for testing array params in query string
Latest commit 3805068 Jun 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ringcentral Support get query with parameter array Jun 7, 2019
.coveragerc Coveralls Jul 29, 2015
.coveralls.yml Coveralls Jul 29, 2015
.dockerignore Support get query with parameter array Jun 7, 2019
.editorconfig
.gitignore Support get query with parameter array Jun 7, 2019
.travis.yml 0.7.10 Aug 21, 2018
CONTRIBUTING.md 0.7.9 Setup Mar 13, 2018
Dockerfile2 Support get query with parameter array Jun 7, 2019
Dockerfile3 Support get query with parameter array Jun 7, 2019
LICENSE.md Initial commit Feb 20, 2015
MANIFEST Manifest Sep 26, 2015
MANIFEST.in 0.7.9 Setup Mar 13, 2018
Makefile Support get query with parameter array Jun 7, 2019
README.md Added demo sms Dec 20, 2018
config.py 0.7.7 MMS & Fax builder Apr 25, 2017
demo.py fix login (#19) May 2, 2018
demo_cache.py
demo_mms.py 0.7.7 MMS & Fax builder Apr 25, 2017
demo_multipart_mixed.py Support multipart/mixed request (#18) Apr 3, 2018
demo_sms.py Added demo sms Dec 20, 2018
demo_subscription.py 0.7.7 MMS & Fax builder Apr 25, 2017
requirements-dev.txt Setuptools Apr 25, 2017
requirements.txt Support get query with parameter array Jun 7, 2019
setup.cfg Pypi setup Feb 26, 2015
setup.py Support get query with parameter array Jun 7, 2019

README.md

RingCentral SDK for Python

Build Status Coverage Status Community Twitter

RingCentral Developers is a cloud communications platform which can be accessed via more than 70 APIs. The platform's main capabilities include technologies that enable: Voice, SMS/MMS, Fax, Glip Team Messaging, Data and Configurations.

API Reference and APIs Explorer.

Installation

Manual

$ git clone https://github.com/ringcentral/python-sdk.git ./ringcentral-python-sdk

Install dependencies:

PIP

$ pip install ringcentral

Usage

For more info take a look on the test.py in this repository.

from ringcentral import SDK

sdk = SDK('CLIENT_ID', 'CLIENT_SECRET', 'SERVER')
platform = sdk.platform()
platform.login('USERNAME', 'EXTENSION', 'PASSWORD')

res = platform.get('/account/~/extension/~')
print('User loaded ' + res.json().name)

Subscribing for server events

from threading import Thread
from time import sleep
from ringcentral.subscription import Events

def on_message(msg):
    print(msg)

def pubnub():
    s = sdk.create_subscription()
    s.add_events(['/account/~/extension/~/message-store'])
    s.on(Events.notification, on_message)
    s.register()
    while True:
        sleep(0.1)

try:
    try:
        import Pubnub
        t = Thread(target=pubnub)
        t.start()
    except ImportError as e:
        print("No Pubnub SDK, skipping Pubnub test")

except KeyboardInterrupt:
    pass

Send sms

from ringcentral import SDK

database = []
database.append({"Customer":"Tyler","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Chen","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Anne","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Brown","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Peter","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"White","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Lisa","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Dan","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Stephanie","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"})
database.append({"Customer":"Lukas","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"})

sdk = SDK('CLIENT_ID', 'CLIENT_SECRET', 'SERVER')
platform = sdk.platform()
platform.login('USERNAME', 'EXTENSION', 'PASSWORD')

def sendSMS(message, number):  
    params = {'from': {'phoneNumber': 'USERNAME'},'to': [{'phoneNumber': number}],'text': message}
    response = platform.post('/restapi/v1.0/account/~/extension/~/sms', params)
    print('Sent payment reminder to ' + number)

def main():
    for i in range(len(database)):
        customer = database[i]
        if customer['Payment'] is "Due":
            sendSMS("Hi " + customer['Customer'] + ". Your payment is due.", customer['PhoneNumber'])
        time.sleep(5)
    print("Send payment reminder done.")

if __name__ == '__main__':
    main()
You can’t perform that action at this time.