Question

Sending fax via the api is sending a blank page with a watermark

  • 4 December 2020
  • 6 replies
  • 800 views

I'm in the sandbox, writing using the C# SDK. I can programmatically send a fax to the requested number but it appears with no attachment and the cover page has a watermark through it saying - "test fax using ringcentral development account"


What am I missing to transition it to the actual fax while in the sandbox environment?

Thank you.



6 replies

It maybe due to the reason that your attachment files are not getting attached properly.

Can you please refer the following:

https://community.ringcentral.com/questions/8336/sending-pdf-through-fax-with-c.html

and

https://developers.ringcentral.com/guide/messaging/fax/sending-faxes#c#

and see if this helps your issue

Hello, thank you for your help.

I have stripped down the program to just send text as an attachment. I'm sending it from the developer's account in RingCentral to my actual Ring Central phone number on my computer.


When I send it, the cover page says I have 2 pages, but only one is coming through.


Here is my current code.

Byte[] myBytes = File.ReadAllBytes("testing.pdf");

//ar attachment = new Attachment { fileName = "testing.pdf", contentType = "application/pdf", bytes = myBytes };

var attachment = new Attachment { fileName = "test.txt", contentType = "text/plain", bytes = Encoding.UTF8.GetBytes("hello world") };

var attachments = new Attachment[] { attachment };

sendFaxMessageRequest.attachments = attachments;

sendFaxMessageRequest.coverPageText = "this is Bruce's Test";

var r = await rc.Restapi().Account().Extension().Fax().Post(sendFaxMessageRequest);


Also, will the commented out part work for sending a PDF (i.e. the content type and readallbytes) once I get attachments working.


I saw this but I'm unclear how to do it and have been unable to find a sample, can you steer me in the right direction?

---------

To send a fax you'll need to create a multipart/mixed request and add each PDF as an attachment. You can either send the raw bytes or base 64 encode the file.

---------

Thank you

Userlevel 1

Hi Bruce,

Sending fax from a sandbox account is currently broken. It is the problem as you are facing now, no attachment. I created a Jira ticket some time ago but it is still not resolved yet. Meanwhile, fax works correctly in the production environment. I will check the ticket and push for fix asap.

Well, that makes me feel better that I didn't mess up.


Can you let me know the best way to send a pdf? I have the commented code in my previous email, but then saw the comment about creating a multipart and attaching the PDF, I'm not sure how to do that if that's the way I need to do it.

Since I can't check it right now until I go to production, I'm trying to make sure I'm in good shape first.


Thank you,


Bruce

Userlevel 1

I believe that it must be as simple as this

var attachment = new Attachment { fileName = "test.pdf", contentType = "application/pdf", bytes = System.IO.File.ReadAllBytes("test.pdf") };
var attachments = new Attachment[] { attachment };
requestParams.attachments = attachments;


Sounds good, that's what I was doing, I just can't see if it is correct currently in the sandbox.

Thanks for all of your help.

Bruce

Reply