question

mg8729 avatar image
mg8729 asked mg8729 commented

Glip Bot with Python

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?



sdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
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
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
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).
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

John Wang avatar image
John Wang Deactivated answered mg8729 commented
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
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

mg8729 avatar image mg8729 commented ·
Thanks! I was able to get the token using the current SDK. 
1 Like 1 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys