question

ajathar avatar image
ajathar asked benjamin-dean commented

Prod Version Error

Rendering Failed on sending fax to any numbers on production version.



errors
1 |3000

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

benjamin-dean avatar image
benjamin-dean answered
Is this when sending via the API or via the product/soft phone please?
1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
More information is needed for troubleshooting.
1 |3000

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

ajathar avatar image
ajathar answered
Iam sending it through the API. and my API is in PRODUCTION. it was working fine in the Sandbox version.
1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
Could you please post your sample code for sending fax via the API (don't forget to remove your credentials) ? 

Does it always fail regardless of the content of the fax? It is helpful if you give me a runnable sample project to reproduce the issue.
1 |3000

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

ajathar avatar image
ajathar answered
Hi Tyler,

Good Morning.

This is my sample Dot Net Code.

SDK sdk;            var requestBody = JsonConvert.SerializeObject(new
            {
                faxResolution = "High",
                coverIndex = 1,
                coverPageText = "Dummy Test",
                to = new object[] { new { phoneNumber = "123456789" } }
            });

           
            sdk = new SDK("appkey", "appsecret", " https://platform.ringcentral.com";, "Dispatcher", "1.0.0");
           
            sdk.Platform.Login("number", "extension", "password", true);
            var attachments = new List<Attachment>();
            var textBytes = System.Text.Encoding.UTF8.GetBytes("hello fax");
            var attachment = new Attachment(@"test.pdf", "application/pdf", textBytes);
            attachments.Add(attachment);
            var request = new Request("/restapi/v1.0/account/~/extension/~/fax", requestBody, attachments);
            var body = request.HttpContent;
            Assert.NotNull(body);
            var response = sdk.Platform.Post(request);
            Assert.AreEqual(true, response.OK);


Yes it always fails even when i change my contents.
1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
Could you please do me a favor to post a screenshot of the exception you got? Thanks
1 |3000

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

ajathar avatar image
ajathar answered
Hi,

Response after sending the fax.

Response by quering the message id




1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
Sorry for the late reply. But it took me quite a well until I found a possible root cause. 

var textBytes = System.Text.Encoding.UTF8.GetBytes("hello fax");
var attachment = new Attachment(@"test.pdf", "application/pdf", textBytes);

"textBytes" above is plain text, but you tell the server side that it's "application/pdf", that's why server side failed to render it.  

I don't think you can get this code work in sandbox. So please try again and tell me whether it works in sandbox.

And Please also try my sample code:

var textBytes = System.Text.Encoding.UTF8.GetBytes("hello fax");            
var attachment = new Attachment("test.txt", "text/plain", textBytes);

Or if you want to send a pdf file instead:

var pdfBytes = System.IO.File.ReadAllBytes("test.pdf"); 
var attachment = new Attachment("test.pdf", "application/pdf", pdfBytes);

And by the way, now we have another C# library which is much more user friendly:  https://github.com/ringcentral/ringcentral-csharp-client

And here is some sample code for sending fax using the new library:  https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/FaxTest.cs

1 |3000

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

ajathar avatar image
ajathar answered benjamin-dean commented
Hi Tyler,

Thanks for the help.Its working now. Just missed that code. :)
1 comment
1 |3000

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

benjamin-dean avatar image benjamin-dean commented ·
Glad you are back in business.
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