RingCentral Engage Voice API wrapper for Python
Installation
PIP
pip install ringcentral_engage_voice
Usage
from ringcentral_engage_voice import RingCentralEngageVoice
# create from ringcentral app client id /secret
# you can create app from https://developer.ringcentral.com
ev = RingCentralEngageVoice(
'RINGCENTRAL_CLIENT_ID',
'RINGCENTRAL_CLIENT_SECRET'
)
# auth with password flow
ev.authorize(
username = 'USERNAME',
password = 'PASSWORD'
)
# // can also auth with auth code flow
# // check https://developers.ringcentral.com/guide/authentication for more detail
ev.authorize(
code = 'xxxx',
redirectUri = 'yyyyyy'
)
# get access token, will expire in 5 minutes
token = ev.token['accessToken']
# // api request
# // check all api doc from https://engage-voice-api-docs.readthedocs.io/en/latest/
r = ev.get('/api/v1/admin/accounts')
assertEqual(len(r.json()) > 0, True)
For legacy server use:
from ringcentral_engage_voice import RingCentralEngageVoice
# LEGACY_SERVER could be
# 'https://portal.vacd.biz',
# or 'https://portal.virtualacd.biz'
ev = RingCentralEngageVoice(
server = process.env.LEGACY_SERVER
)
# only support username/password auth
await ev.authorize({
username = process.env.LEGACY_USERNAME,
password = process.env.LEGACY_PASSWORD
})
# api request
# check all api doc from https://engage-voice-api-docs.readthedocs.io/en/latest/
let r = ev.get('/api/v1/admin/accounts')
r = r.json()
expect(len(r) > 0).toBe(true)
# revoke api token
ev.revokeLegacyToken()
Instance methods
ev._request(
method,
endpoint,
params = None,
json = None,
data = None,
files = None,
multipart_mixed = False,
headers = None
)
ev.get(endpoint, params = None)
ev.post(endpoint, json = None, params = None, data = None, files = None, multipart_mixed = False)
ev.put(endpoint, json = None, params = None, data = None, files = None, multipart_mixed = False)
ev.patch(endpoint, json = None, params = None, data = None, files = None, multipart_mixed = False)
ev.delete(endpoint, params = None)
Test
bin/init
source venv/bin/activate
pip install -r requirements.txt
cp env-sample.env .env
# edit .env fill all fields
./bin/test
Credits
Based on Tyler's https://github.com/tylerlong/ringcentral-python.
License
MIT
Release files for ringcentral-engage-voice 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ringcentral_engage_voice-0.2.3.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ringcentral_engage_voice-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / ringcentral_engage_voice-0.2.3.tar.gz
| Download URL | ringcentral_engage_voice-0.2.3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
960104e400940abd2a6ea800fa42fe674d1b17c463a1529711781dc8590b3cb5
|
|
BLAKE2b-256 checksum How to use checksums |
a63ca8850903b699f1a1b2e70882acf36b35792d8e33888948c5478c548d12d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|
Release files / ringcentral_engage_voice-0.2.3-py3-none-any.whl
| Download URL | ringcentral_engage_voice-0.2.3-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff4001615d465b1e6997bc5234469123f67ad920e3903e84434191816b349303
|
|
BLAKE2b-256 checksum How to use checksums |
f756749f4588519a3b289adeeb2e118dd96a15ebf43e34db252a63ad184d2708
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|