Getting messageStatus = "SendingFailed" and faxErrorCode = "RenderingFailed" ?

  • 1
  • Question
  • Updated 7 months ago
Hi Team,

I am getting messageStatus = "SendingFailed" and faxErrorCode = "RenderingFailed"getting while sending fax message, what can be the reason ?
Photo of Patient Fax

Patient Fax

  • 100 Points 100 badge 2x thumb

Posted 7 months ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,914 Points 5k badge 2x thumb
RenderingFailed usually means contentType is wrong.

For example, you want to fax a PNG image, and you specify contentType = "application/pdf". Server side cannot render a PNG image as PDF, thus RenderingFailed.
Photo of Patient Fax

Patient Fax

  • 100 Points 100 badge 2x thumb
Hi Tyler,

I have specified correct contentType in my fax message but though its giving me above error.don't know how.

i have attached one pdf file in fax message and given contentType = "application/pdf".

here is response where xyz specify messageid.

{
  "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/xyz";,
  "id": xyz,
  "to": [
    {
      "phoneNumber": "+14246347683",
      "location": "Redondo, CA",
      "messageStatus": "SendingFailed",
      "faxErrorCode": "RenderingFailed"
    }
  ],
  "type": "Fax",
  "creationTime": "2017-12-06T04:58:58.000Z",
  "readStatus": "Unread",
  "priority": "Normal",
  "attachments": [
    {
      "id": xyz,
      "uri": "https://media.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/xyz/content/x...;,
      "type": "RenderedDocument",
      "contentType": "application/pdf"
    }
  ],
  "direction": "Outbound",
  "availability": "Alive",
  "messageStatus": "SendingFailed",
  "faxResolution": "High",
  "faxPageCount": 0,
  "lastModifiedTime": "2017-12-06T05:05:23.637Z",
  "coverIndex": 7,
  "coverPageText": "TEst note"
}
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,190 Points 5k badge 2x thumb
I'd like to see the code you used to send the fax.
Photo of Patient Fax

Patient Fax

  • 100 Points 100 badge 2x thumb
we are using following code after authorization.

var attachment1 = new Attachment { fileName = documentName, contentType = fileType, bytes =  Encoding.UTF8.GetBytes(outArray)};

var attachments = new Attachment[] { attachment1  };


varextension=rc.Restapi().Account().Extension();

ToFax="+14246347683";


var response=await extension.Fax().Post(new FaxPath.PostParameters{
  to=new CallerInfo[] { new CallerInfo { phoneNumber=ToFax } },
  coverPageText=CoverPageText,
  coverIndex=CoverIndex
},
attachments );
Photo of Tyler Long

Tyler Long, Official Rep

  • 5,190 Points 5k badge 2x thumb
I am not sure. But from `bytes = Encoding.UTF8.GetBytes(outArray)` I conclude that `outArray` is a string. If it is a PDF file, how can you represent it as a string?

You should read the PDF bytes like this: bytes = System.IO.File.ReadAllBytes("test.pdf")
Photo of Patient Fax

Patient Fax

  • 100 Points 100 badge 2x thumb
Hi Tyler,

above solution worked for us. thank you for your help