Skip to main content

RingCentral Engage Voice client Python

Project description

RingCentral Engage Voice Python SDK

Build Status Coverage Status

API docs.

Installation

PIP

pip3 install ringcentral_engage_voice
# or
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',
  extension = 'EXTENSION' # optional
)
# // 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)

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)

Virtual Environment

The venv module allows you to create a lightweight "virtual environment" within your own site directory, isolated from system site directories. The virtual environment has it's own Python binary and can have its own independent set of installed Python packages in its site directories. This is a good way to to create an isolated test environment to test out this code

Test

To use the virtual environments, make sure you have pip3 and python3.6+ setup, then execute the following:

bin/init
source venv/bin/activate
pip install -r requirements.txt
cp env-sample.env .env
# edit .env fill all fields

# now test
./bin/test

# test non-lagecy API
python3 test/engage_voice_spec.py

# test lagecy API only
python3 test/engage_voice_lagecy_spec.py

To test without virtual environments and in your system directory, make sure you have pip3 and python3.6+, then execute the following:

pip3 install -r requirements-dev.txt
pip3 install -r requirements.txt
cp env-sample.env .env
# edit .env fill all

# now test
./bin/test

Credits

Based on Tyler's https://github.com/tylerlong/ringcentral-python.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ringcentral_engage_voice-0.3.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ringcentral_engage_voice-0.3.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file ringcentral_engage_voice-0.3.2.tar.gz.

File metadata

  • Download URL: ringcentral_engage_voice-0.3.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for ringcentral_engage_voice-0.3.2.tar.gz
Algorithm Hash digest
SHA256 204ec8ec2fc1b6ca3a77998df52cf30b5c13ff1bab8999f3174d7611cdeb1552
MD5 f2f19e6a35d11a048aeec491b629c5b7
BLAKE2b-256 b6a08858648cd5f19f8ab8b843365198184ae14d4347b70d971956da63645fea

See more details on using hashes here.

File details

Details for the file ringcentral_engage_voice-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ringcentral_engage_voice-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for ringcentral_engage_voice-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5435857f608a78ef5cfdf290dea2e2e79f2c965ab81082a0362ef6090b7b5c4d
MD5 340e7e9cb8e2db0b92362a4d297e09d1
BLAKE2b-256 93f31e4faa3b335c0846442beaa1fd88a67bdf6f048172908cd42a1532fd3a02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page