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
fax attachment not being faxed -Python SDK
Tags: fax
Dec 1, 2022 at 8:57am   •   1 replies  •  0 likes
Fausto Chepil

This is code snippet communicating with RC API that attempts to send a pdf doc for faxing.


rcsdk = SDK(RINGCENTRAL_CLIENTID,
RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER)


platform = rcsdk.platform()
platform.login(RINGCENTRAL_USERNAME,
RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD)


# platform.login(jwt=RC_JWT)
builder = rcsdk.create_multipart_builder()
builder.set_body({
  
  
'to': [{'phoneNumber': recipient}],
'faxResolution': "High",
'coverPageText': "Clinic Name \n" + str(sender)
})


with open(faxdoc, encoding="utf8", errors='ignore') as f:
 content = f.read()
 attachment = (faxdoc, content)


builder.add(attachment)


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


resp = platform.send_request(request)


Everything looks good and this is output in terminal:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): platform.devtest.ringcentral.com:443

DEBUG:urllib3.connectionpool:https://platform.devtest.ringcentral.com:443 "POST /restapi/oauth/token HTTP/1.1" 200 574

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): platform.devtest.ringcentral.com:443

DEBUG:urllib3.connectionpool:https://platform.devtest.ringcentral.com:443 "POST /restapi/v1.0/account/~/extension/~/fax HTTP/1.1" 200 None

INFO:root:E:\pyfaxrc\apps\response\12047861522__E:\pyfaxrc\apps\outbound\test.pdf


The fax that is received is 2 pages, a cover page and a 2nd page that has a watermark saying "test fax using ring central developer account"

The Sandbox Console shows the service as having a successful transmission, even though the attachment was not sent.

if I test with a jpeg attachment, I do not receive any fax and the event logs are identical as the pdf, with exception of the filename and extension.

(The code snippet that opens the file was changed per RC community advisement as I was receiving errors when using the original code sample.)

Any advisement appreciated.

1 Answer
answered on Nov 17, 2022 at 8:23pm  

This is a known issue that fax attachment is not supported in sandbox environment. If you could call the API successfully and receive the cover pages, then your code is good to go on production.


 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