question

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?

faxruby
1 |1000

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

3 comments
1 |1000

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

Frank Bowers avatar image Frank Bowers commented ·

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 ·
Frank Bowers avatar image Frank Bowers Frank Bowers commented ·

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 ·
Phong Vu avatar image Phong Vu ♦♦ Frank Bowers commented ·

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 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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