Frank Bowers avatar image
Frank Bowers asked Phong Vu commented

Can I fax a file object via Ruby SDK?

We are integrating RingCentral for faxing and replacing a previous ruby solution. In our solution a PDF (customer invoice) is generated and then faxed, without ever becoming a file on disk.

From what I can glean from the ringcentral-ruby sdk, this isn't possible. Am I missing something? From the examples I'm seeing, its expecting a file on disk, relative to the project. This won't work for us, because its going to be running as a background worker on a server with no local file access.

Is there something I'm missing in the SDK, or some code example of how to get the file data to RingCentral? Or do I need to not use the SDK and code the request by hand?

rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

Check out this quick start. Scroll down and click the Ruby tab to see sample code to send fax in Ruby

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Already did that. That requires the file to be openable by Faraday at a filepath - it doesn't seem to take a binary file object loaded into memory.

0 Likes 0 ·

I may have figured it out by using ruby's Tempfile class - which I think will work in this situation for Heroku. Still have to test it on their servers though. It'd be great if the ruby SDK could be changed to allow direct binary object attachments.

0 Likes 0 ·

Got it. I will have a look at it and see if I can add that feature to the SDK.

Thanks for your feedback!

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys