News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Get an InvalidParameter error when trying to send a fax through API
Tags: errors, rest api
Feb 8, 2019 at 5:43am   •   2 replies  •  0 likes
dlavigna

using this API

restClient.post(      restClient.restApi("v1.0").account("~").extension("~").fax().endpoint(), 

qParam);


with Query parameters

QueryParameter[] qParam = new QueryParameter[3];

QueryParameter p0 = new QueryParameter("attachment", "");

QueryParameter p1 = new QueryParameter("faxResolution", "High");

QueryParameter p2 = new QueryParameter("to", "+14694804418");

qParam[0] = p0;

qParam[1] = p1;

qParam[2] = p2;

The error message is:
com.ringcentral.RestException: HTTP status code: 400

{

"errorCode" : "InvalidParameter",

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

"errors" : [ {

"errorCode" : "CMN-101",

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

"parameterName" : ""

} ],

"parameterName" : ""

}

2 Answers
answered on Feb 8, 2019 at 9:35am  
Sorry for misunderstood. I just quick looked at your code and thought that it was C#. 

Here is the example to send a Fax message using the Java SDK.

https://github.com/ringcentral/ringcentral-java/blob/master/src/test/java/com/ringcentral/FaxTest.ja...

+ Phong

 0
answered on Feb 8, 2019 at 6:51am  
Hi, 

Here is snippet code to send fax.

var attachment = new Attachment { fileName = "test.jpg", contentType = "image/jpeg", bytes = System.IO.File.ReadAllBytes("test.jpg") };
var attachments = new Attachment[] { attachment };
var body = new {
               to = new CallerInfo[] { new CallerInfo { phoneNumber = RECIPIENT } },
               faxResolution = "High",
               coverPageText = "This is a demo Fax page from C Sharp"
               };
var resp = await rc.Restapi().Account().Extension().Fax().Post(body, attachments); 

Hope this helps!
+ Phong

 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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us