Can someone please help me writing a simple python script to get the oauth token using api.
,
need some help in writing a simple python code to retrieve oauth token
Can someone please help me writing a simple python script to get the oauth token using api.
,
need some help in writing a simple python code to retrieve oauth token
Is there a example without using the sdk
because when i use SDK i keep getting this error
ImportError: cannot import name 'SDK' from partially initialized module 'ringcentral' (most likely due to a circular import)
That is the tutorial is about "Access RingCentral platform services using Python native API."
So the thing with native api example is that it needs 'password': os.getenv("RC_PASSWORD")
but we have enabled sso on our account so how will that work?
It depends on the account SSO settings. Most of the cases is that it'll not support password flow after enabling SSO.
Implement 3-legged authentication login requires you writing lots of codes. That is why I recommend you to use the SDK. Your problem is your environment and I don't know how you set/install the RingCentral Python SDK. you should solve that problem or then look at the source code of the SDK to implement your own. https://github.com/ringcentral/ringcentral-python
I don't know what you want to refer to. That code is the RingCentral Python SDK, which helps developers easier to login RingCentral platform. It can be used to login with password flow or OAuth authorization.
To be honest, I don't know what you want to do as your original question is about how to retrieve auth token.
After you log in either ways, you will get the access tokens. And this sample code helps you to achieve the tokens via OAuth. Your problem is you don't know Flask so you cannot use the code as such. But it should help with the basic steps.
https://developers.ringcentral.com/guide/authentication/quick-start#python
@app.route('/oauth2callback', methods=['GET']) def oauth2callback(): platform = rcsdk.platform() auth_code = request.values.get('code') platform.login('', '', '', auth_code, RINGCENTRAL_REDIRECT_URL) tokens = platform.auth().data() session['sessionAccessToken'] = tokens return render_template('test.html')
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:
5 People are following this question.