ringcentral / ringcentral-python

RingCentral Connect Platform Python SDK
MIT License
43 stars 35 forks source link

error sending fax #54

Closed tylerlong closed 12 months ago

tylerlong commented 1 year ago

Issue below is reported by a developer:

This is the code where the issue begins:

...

attachment = ('fax.jpg', open('fax.jpg','r').read(), 'image/jpeg') builder.add(attachment)

...

This is the error that I get when I attach a document:

File "/home/username/Projects/project-paths/fax.py", line 71, in send_fax resp = platform.send_request(request) File "/home/username/.local/lib/python3.9/site-packages/ringcentral/platform/platform.py", line 173, in send_request return self._client.send(self.inflate_request(request, skip_auth_check=skip_auth_check)) File "/home/username/.local/lib/python3.9/site-packages/ringcentral/http/client.py", line 34, in send raise ApiException(response, e) File "/home/username/.local/lib/python3.9/site-packages/ringcentral/http/api_exception.py", line 14, in init if api_response.error(): File "/home/username/.local/lib/python3.9/site-packages/ringcentral/http/api_response.py", line 77, in error message = message + ' (and additional error happened during JSON parse: ' + e.message + ')' AttributeError: 'Exception' object has no attribute 'message'

tylerlong commented 1 year ago

As a temporary workaround, please use https://github.com/tylerlong/ringcentral-python

LohithNarayan commented 1 year ago

In Python 3.x and modern versions of Python 2.x use except Exception as e instead of except Exception, e: PR #62

LohithNarayan commented 1 year ago

@tylerlong I have created a Demo code and we are able to send and receive Fax. demo_fax.py #64 https://github.com/ringcentral/ringcentral-python/pull/64

tylerlong commented 12 months ago

https://github.com/ringcentral/ringcentral-python/blob/master/ringcentral/demos/demo_fax.py