RingCentral Engage Voice client Python
Project description
RingCentral Engage Voice API wrapper for Python
Installation
PIP
pip install ringcentral_engage_voice
Usage
pip install ringcentral_engage_voice
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ringcentral_engage_voice-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13d4237ae9b5bd7a7fb7d82f3e4ea7a1cf34a21fb9f018b60c27180a22c22ce9 |
|
MD5 | a047609ab6b78452e181b5bb5ed825b0 |
|
BLAKE2b-256 | eda87e8febb4de6f24d853fc59f1eb444790ff26ce71ad5a68b4686113c19582 |
Close
Hashes for ringcentral_engage_voice-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4929c4bc552d57a140a6bdbb5eb01d601b2a7e4e9342c579f752ec30873b3a8a |
|
MD5 | a42c53ca8dd0edf7e83452b8710dbb32 |
|
BLAKE2b-256 | a0b91ac889900c15303d29f30e7adbb40ddbd7acfd9da54a6665b237ed3e731f |