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
See this tutorial. Or this quick started sample using the Python SDK.
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."
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()
sessiono'sessionAccessToken'] = tokens
return render_template('test.html')
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.