Subscribe Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security. Subscribe

Add_run method returns 400

I am trying add_run method as follows after going through the example post request in binding section for java

Map data = new HashMap();
data.put(“name”,“This is a new test run”);
data.put(“include_all”, false);
data.put(“assignedto_id”, 2);
data.put(“refs”, “BDDAUT-3”);
data.put(“case_ids”,new Integer {5});
JSONObject r = (JSONObject) client.sendPost(“add_run/1”, data);

but I am getting error TestRail API returned HTTP 400(“Invalid or incomplete JSON string in API request.”)

Please help What is wrong here.