News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
400 Error using Production Call log API
Tags: extension
May 4, 2023 at 9:29am   •   3 replies  •  0 likes
Albin Hamilton - Acting Senior IT Support Speciali(M-F) 9 TO 6PM CST

Hi Yesterday I created an app using the call log API and I was able to test it using the sandbox environment. I was able to get the app graduated with multiple requests. I Made all the changes in my code to include the credentials for the production environment and I am getting 400 error which make me think there is an issue with the user credentials. I did notice that the production environment is using an extension that is not mine, it belongs to one of our super users. Do I need to use the password for that extension, or can I use the password of my extension to run the script.
Is there any way to change the extension to mine ?

3 Answers
answered on May 8, 2023 at 1:07pm  
Thank you , I was able to retrieve my call log using my extension and password ( Ext 235) . I can see the production app is under a different extension(102) that is not mine. It belongs to another super admin, is there anyway to modify the extension in the app so that it uses mine ? that way i will be able to retrieve the information i need Or maybe there's something wrong with my parameters.

This is my code :

import json
from pprint import pprint

from ringcentral import SDK

with open('Ringcentral_call_log_Api\secrets.json') as f:
    secrets = json.load(f)
 
rcsdk = SDK(secrets['clientId'], secrets['clientSecret'], secrets['server'])
platform = rcsdk.platform()
platform.login(secrets['username'], secrets['extension'], secrets['password'])
 
params = {
     #'extensionNumber': '<ENTER VALUE>',
    #'showBlocked': true,
    #'phoneNumber': '<ENTER VALUE>',
    #'direction': [ 'Inbound', 'Outbound' ],
    #'sessionId': '<ENTER VALUE>',
    #'type': [ 'Voice', 'Fax' ],
    #'transport': [ 'PSTN', 'VoIP' ],
    #'view': 'Simple',
    #'withRecording': true,
    #'recordingType': 'Automatic',
    #'dateTo': '<ENTER VALUE>',
    #'dateFrom': '<ENTER VALUE>',
    #'page': 000,
    #'perPage': 000,
    #'showDeleted': true
    'perPage': 1000
}
 
resp = platform.get('/restapi/v1.0/account/~/extension/~/call-log', params)
pprint(resp.json_dict())

 0
answered on May 4, 2023 at 10:00pm  

@Phong Vu Thank you for the help , this is the End point im calling:

resp = platform . get ( '/restapi/v1.0/account/~/extension/~/call-log' , params )


Using this end point requires me to authenticate the app with a super admin user right ?


 0
on May 5, 2023 at 7:37am   •  0 likes

No, this endpoint is for reading the user call log data and the user is the one being authenticated.

Double check the app credentials for production and make sure the username and password is of the user under your production account.

If you still get the 400 status, post the query params so I can have a look at it.

answered on May 4, 2023 at 3:55pm  

What endpoint do you call, the user call log or the account call log? If you call the account call log endpoint, you must authenticate the app with a super admin user, or a custom user role that include the access account call log user permission.

To make sure that your code works well, just call the user call log with the tilde "~" at the extension id in the path. I.e. "/restapi/v1.0/account/~/extension/~/call-log"


 1



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us