Skip to main content

Hello,


I trying to setup a bot using Python, but it doesn't seems like the Python SDK has the same methods as the JS SDK.


For example, with the JS SDK, it seems possible to do something like:


rcsdk = new RC({ server: RINGCENTRAL_ENV, appKey: CLIENT_ID, appSecret: CLIENT_SECRET});

platform.login({ code : req.query.code, redirectUri : REDIRECT_HOST + '/oauth' });


Taken from https://github.com/pkvenu/developing-locally-with-Glip/blob/master/app.js


But, in the Python SDK, the login method of the Platform class only takes username and password.


Reference: https://github.com/ringcentral/ringcentral-python/blob/master/ringcentral/platform/platform.py


It doesn't seem like there's a way to do something equivalent with the 'Python SDK' after adding the app/Bot to Glip to finally get the permanent token?



I checked the code of the official Python SDK, it doesn't support authorization code flow. I created an GitHub issue: https://github.com/ringcentral/ringcentral-python/issues/14

You can use this unofficial SDK instead: https://github.com/tylerlong/ringcentral-python It does support authorization code flow: https://github.com/tylerlong/ringcentral-python#step-4-authorize
And there is a way to get a permanent token without writing any code: https://github.com/tylerlong/ringcentral-token-generator

As long as you get the token, you can set the token to the Python SDK. Thus you can skip the authorization step (because you've already got the token).
An authorization code demo app using the official ringcentral-python SDK is available here:

https://github.com/ringcentral/ringcentral-demos-oauth/tree/master/python-bottle

Reply