Prod Version Error
Tags: error
Jan 24, 2017 at 2:45am • 9 replies • 0 likes
ajathar
Rendering Failed on sending fax to any numbers on production version.
9 Answers
Sorry for the late reply. But it took me quite a well until I found a possible root cause.
"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:
Or if you want to send a pdf file instead:
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
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
0
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.
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.
0
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