Skip to main content

Hi, I have my APP_KEY, APP_SECRET, USERNAME, PASSWORD.

I have also a little knowledge of python. I want to download detail call log without fax and Inbound calls between two defined date.

Any idea or sample script will be very helpful for me.

Thanks

When making a call to the call-log end point, set the following query parameters:

  • dateFrom
  • dateTo
  • direction = 'Outbound'
  • type = 'Voice'
  • view = 'Detailed'

See this example in Python here:

https://github.com/grokify/ringcentral-python-examples/blob/master/demo_call-log.py
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:Python34libsite-packages
ingcentralplatformplatform.py", line 105, in login
    raise e
  File "C:Python34libsite-packages
ingcentralplatformplatform.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

Reply