Java API Client able to add studies to StudyProperties query | Jason | 2012-02-10 13:56 | |||||||||||||||||||||
Status: Closed | |||||||||||||||||||||||
I am brand new to Labkey Server and client API. I have local installation of Labkey Server running and I am trying to use the Java API to add studies under a project folder. My questions are as follows: 1. Is it possible to have multiple studies under one project folder? 2. Why am I unable to execute the following code even though I am a Site Administrator? I get a 401 Unauthorized response code, but I am able to select and update from the same schema/table. Connection cn = new Connection("http://localhost:8080/labkey", "email address goes here", "password goes here"); InsertRowsCommand cmd = new InsertRowsCommand("study", "StudyProperties"); Map<String, Object> row = new HashMap<String, Object>(); row.put("Label", "This is a study label"); row.put("Investigator", "Smith, John"); cmd.addRow(row); SaveRowsResponse resp; try { resp = cmd.execute(cn, "Project folder name goes here"); System.out.println(resp.getRowsAffected()); } catch (CommandException e) { System.out.println(e.getStatusCode()); System.out.println(e.getMessage()); System.out.println(e.getResponseText()); } Any help would be greatly appreciated! |
|||||||||||||||||||||||
| |||||||||||||||||||||||