orchard-medical-center avatar image
orchard-medical-center posted clear2220 commented

unable to parse fax envelope

When POSTing from vb, I get the error "unable to parse fax envelope". The POST payload looks exactly the same as the one I am sending from the REST client which works fine.

It took a while to realize that I should only use Line Feeds "Chr(10)" and not Carriage Returns "Chr(13)" !!!

I searched this site looking for an answer, but I guess no one else had run into this problem before. 

Hopefully, this will save the next person some time.
faxcarriage returnline endingsnewlineunix
1 |1000

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 ·
Windows VS Linux newlines is always a problem for systems which are sensitive to these types of nuances.

Thanks a TON for sharing your VB experience. I will tag this post respectively.

I've also converted this to an article.

You are welcomed to submit a Pull Request to the RingCentral FAQ repository on Github (to include this in the official FAQ) if you would be interested.

0 Likes 0 ·
clear2220 avatar image clear2220 commented ·
I also had this issue as my c# classes are in PascalCase, and Newtonsoft serializer output this:
{   "To": [     {       "PhoneNumber": "16461231234"     }   ],   "FaxResolution": "High" }
in addition with the CRLF.

I fixed this by using this in my FaxRequestBody class:

public string ToJsonString()         {             string json = JsonConvert.SerializeObject(this,                                                        Formatting.None, // so there's no CRLF                                                       new JsonSerializerSettings                                                       {                                                           NullValueHandling = NullValueHandling.Ignore, //this so nulls are not shown                                                           ContractResolver = new CamelCasePropertyNamesContractResolver() //this so PhoneNumber property is output as phoneNumber                                                       });             return json;         }
0 Likes 0 ·



orchard-medical-center contributed to this article

Related Articles