https://github.com/ringcentral/ringcentral-python
RingCentral Connect Platform Python SDK
https://github.com/ringcentral/ringcentral-python
python sdk
Last synced: 8 months ago
JSON representation
RingCentral Connect Platform Python SDK
- Host: GitHub
- URL: https://github.com/ringcentral/ringcentral-python
- Owner: ringcentral
- License: mit
- Created: 2015-02-20T01:31:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-12-04T17:08:16.000Z (over 1 year ago)
- Last Synced: 2025-04-03T20:09:29.361Z (about 1 year ago)
- Topics: python, sdk
- Language: Python
- Homepage:
- Size: 988 KB
- Stars: 46
- Watchers: 20
- Forks: 37
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RingCentral SDK for Python
[](https://github.com/ringcentral/ringcentral-python/actions/workflows/unit-tests.yml)
[](https://coveralls.io/github/ringcentral/ringcentral-python?branch=master)
[](https://ringcentral.github.io/ringcentral-python/ringcentral.html)
[](https://twitter.com/RingCentralDevs)
__[RingCentral Developers](https://developer.ringcentral.com/api-products)__ is a cloud communications platform which can be accessed via more than 70 APIs. The platform's main capabilities include technologies that enable:
__[Voice](https://developer.ringcentral.com/api-products/voice), [SMS/MMS](https://developer.ringcentral.com/api-products/sms), [Fax](https://developer.ringcentral.com/api-products/fax), [Glip Team Messaging](https://developer.ringcentral.com/api-products/team-messaging), [Data and Configurations](https://developer.ringcentral.com/api-products/configuration)__.
## Additional resources
* [RingCentral API Reference](https://developer.ringcentral.com/api-docs/latest/index.html) - an interactive reference for the RingCentral API that allows developers to make API calls with no code.
* [Document](https://ringcentral.github.io/ringcentral-python/ringcentral.html) - an interactive reference for the SDK code documentation.
## Important change logs
- In version 0.9.0, we removed PubNub support. If you need subscription to events, please use WebSocket instead. Please refer to [demo_subscription.py](./ringcentral/demos/demo_subscription.py) for more information.
- If you still need PubNub support, please use version 0.8.x.
## Installation
This SDK is tested against Python 3.7 so we recommend [installing using it with Python 3.7 or newer](https://www.python.org/downloads/)
```sh
$ pip3 install ringcentral
```
## Usage
Take a look at a sample code.
```py
from ringcentral import SDK
sdk = SDK('CLIENT_ID', 'CLIENT_SECRET', 'SERVER')
platform = sdk.platform()
platform.login(jwt='JWT_TOKEN')
res = platform.get('/account/~/extension/~')
print('User loaded ' + res.json().name)
```
## Subscribing for server events
Please refer to [demo_subscription.py](./ringcentral/demos/demo_subscription.py)
## Send sms
```py
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(jwt='JWT_TOKEN')
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()
```
## dev-notes
https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md