Question

C# Sending Fax - Parameter [to] value is invalid.

  • 9 February 2024
  • 2 replies
  • 117 views

We are using NugetPackage 6.1.1 and getting "Parameter [to] value is invalid." when sending a fax.

The error message and examination of the code in the RingCentral.Net library shows that the request is being sent as formData with a request.json parameter and the CreateMessageRequest serialized as JSON.

Is this correct? Should the library be sending FormData with individual paramters?

RingCentral.RestException: 'Response:

StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:

{

Date: Fri, 09 Feb 2024 21:38:57 GMT

Connection: keep-alive

RCRequestId: a11e264c-c793-11ee-a688-005056bbd8ff

RoutingKey: SJC11P01PAS01

X-Rate-Limit-Group: heavy

X-Rate-Limit-Limit: 10

X-Rate-Limit-Remaining: 9

X-Rate-Limit-Window: 60

CF-Cache-Status: DYNAMIC

Server: cloudflare

CF-RAY: 852f43222dcd6c20-DFW

Content-Type: application/json;charset=utf-8

Content-Length: 246

Content-Language: en-US

}

Content: {

"errorCode" : "InvalidParameter",

"message" : "Parameter [to] value is invalid.",

"errors" : [ {

"errorCode" : "CMN-101",

"message" : "Parameter [to] value is invalid.",

"parameterName" : "to"

} ],

"parameterName" : "to"

}


Request:

Method: POST, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/fax', Version: 1.1, Content: System.Net.Http.MultipartFormDataContent, Headers:

{

X-User-Agent: Unknown/0.0.1 RingCentral.Net/6.1.1

Authorization: Bearer ***

Request-Context: appId=cid-v1:e4663832-4025-415d-9de8-032949192fbf

Request-Id: |2fb8e6b3fe3342300ee87c258eb31fc7.250cf52c456bb8fc.

traceparent: 00-2fb8e6b3fe3342300ee87c258eb31fc7-250cf52c456bb8fc-00

Content-Type: multipart/form-data; boundary="6891f609-723d-4277-8042-4621dbca7605"

Content-Length: 260466

}

Content: --6891f609-723d-4277-8042-4621dbca7605

Content-Type: application/json; charset=utf-8

Content-Disposition: form-data; name=request.json


{"faxResolution":"High","to":[{"phoneNumber":"+**********"}],"sendTime":"2/9/2024 2:06 PM"}

--6891f609-723d-4277-8042-4621dbca7605

Content-Type: application/pdf

Content-Disposition: form-data; name=attachments; filename=Negotiation_178370-ScaCoversheet.pdf; filename*=utf-8''Negotiation_178370-ScaCoversheet.pdf


%PDF-1.7

************************************


2 replies

Userlevel 1

Check out this dev guide sample code. The bodyParams must be the CreateFaxMessageRequest object and the "to" is the FaxReceiver[].

That is exactly what we have used to create our fax request. Is there a specific format for the phone or "to" values as the examples don't show how those are formatted. We use the .Net SDK to create all of this, yet it does not work.

Reply