Hi Sir,
Thanks for your help with the code, I have tried but getting an error, Actually I am confused where I need to put my login details and secret keys etc. Here I have added my code and error found.
Thanks
Here is my code sample:
import os
from dotenv import load_dotenv
load_dotenv(dotenv_path=os.getenv('ENV_PATH'))
from ringcentral import SDK
sdk = SDK(
os.getenv('MyClientId'),
os.getenv('Mysecret Key'),
os.getenv('https://platform.devtest.ringcentral.com'))
platform = sdk.platform()
platform.login(
os.getenv('MyUsername'),
os.getenv('MyExtention'),
os.getenv('MyPassword'))
try:
from urllib import urlencode
except: # For Python 3
from urllib.parse import urlencode
query = {
'dateFrom': '2018-05-01T00:00:00Z',
'dateTo': '2018-06-01T00:00:00Z',
'direction': 'Outbound',
'type': 'Voice',
'view': 'Detailed'}
qs = urlencode(query)
res = platform.get('/restapi/v1.0/account/~/extension/~/call-log?'+qs)
print(res.text())
Here is the error:
Traceback (most recent call last):
File "C:/Python34/Ringcentral.py", line 20, in <module>
os.getenv('MyPassword'))
File "C:\Python34\lib\site-packages\ringcentral\platform\platform.py", line 105, in login
raise e
File "C:\Python34\lib\site-packages\ringcentral\platform\platform.py", line 82, in login
raise Exception('Either code or username with password has to be provided')
Exception: Either code or username with password has to be provided