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
Python ringcentral.http.api_exception.ApiException: Unknown error
Tags: sdk
Oct 4, 2018 at 8:04am   •   6 replies  •  0 likes
rick-smith

Using this code:

It ringcentral.http.api_exception.ApiException: Unknown error

I was thinking this may be related to the Python version I was using 3.7 so I switched to 3.6 no joy (What version(s) of Python does it work with BTW?) I'm at a standstill here, any ideas?


from ringcentral import SDK

#sdk = SDK(CLIENT_ID, CLIENT_SECRET, SERVER)

platform = sdk.platform()

platform.login(user, extension, password) #this throws unknown error

builder = sdk.create_multipart_builder()

builder.set_body({


'from': {'phoneNumber': '15551212'},

'to': [{'phoneNumber': '15551213'}],

'text': 'message'

})


request = builder.request('/account/~/extension/~/sms')

response = platform.send_request(request)




6 Answers
answered on Oct 6, 2018 at 7:00am  
Tyler.
Thanks much I will try both.



 0
answered on Oct 5, 2018 at 5:20pm  
That's weird. You can create an issue here: https://github.com/ringcentral/ringcentral-python/issues

In the mean time, you can try my SDK: https://github.com/tylerlong/ringcentral-python

 0
answered on Oct 5, 2018 at 10:38am  
Tyler thanks for your response!
I get this
Exception: Refresh token has expired



 0
answered on Oct 5, 2018 at 6:23am  
Could you please post the body of ApiResponse ?  Try something like str(ApiResponse ) or ApiResponse.json()

Or 

try:
    ...
except Exception as e:
    print(str(e))

 0
answered on Oct 5, 2018 at 6:05am  
Tyler,
Thanks for the response: Here's what  I have:
-        _ApiException__apiResponse    <ringcentral.http.api_response.ApiResponse object at 0x00000001026DE748>    ApiResponse

        api_response    <function ApiException.api_response at 0x0000000103493158>    function

-        headers    {'Accept': 'application/json', 'Authorization': 'Basic NVZSUUMtSnRUa...hV2ZxUQ==', 'Content-Type': 'application/x-www-f...rlencoded', 'RC-User-Agent': 'Unnamed/0.0.0 win32...K/VERSION', 'User-Agent': 'Unnamed/0.0.0 win32...K/VERSION'}    dict

        ['User-Agent']    'Unnamed/0.0.0 win32/VERSION PYTHON/VERSION RCPYTHONSDK/VERSION'    str

Thanks Again!







 0
answered on Oct 4, 2018 at 4:45pm  
Could you please inspect the HTTP response and post the full body here? Normally there should be a error code and a helpful message from server side.

 0



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