public async Task <string> GetStatusByResearchObjectById(long id) { string functionName = "get-status-by-research-object-id-and-version"; string entityName = "submission"; string parameterName = "researchobjectid"; string url = Broker.Server + "/" + pathToApi + entityName + "/" + functionName + "/" + addtionalPath + "/";; string json = "{\"" + parameterName + "\":" + id + "}"; string encodedParameters = WebServiceHelper.Encode(json); return(await BasicWebService.Call(url, Broker.UserName, Broker.Password, encodedParameters)); }
//Get projects by username public async Task <string> GetProjectsByUser(long id) { string functionName = "get-projects-by-user"; string entityName = "project"; string parameterName = "userid"; string url = Broker.Server + "/" + pathToApi + entityName + "/" + functionName + "/" + addtionalPath + "/";; string json = "{\"" + parameterName + "\":" + id + "}"; string encodedParameters = WebServiceHelper.Encode(json); return(await BasicWebService.Call(url, Broker.UserName, Broker.Password, encodedParameters)); }
//getUser /// <summary> /// /// </summary> /// <param name="email"></param> /// <returns></returns> public async Task <string> GetUserByEmail(string email) { string functionName = "get-user-by-email-address"; string entityName = "userextension"; //string addtionalPathX = @"json"; string url = @"" + Broker.Server + "/" + pathToApi + entityName + "/" + functionName + "/" + addtionalPath + "/"; string json = "{\"emailaddress\":\"" + email + "\"}"; string encodedParameters = WebServiceHelper.Encode(json); return(await BasicWebService.Call(url, Broker.UserName, Broker.Password, encodedParameters)); }
/// <summary> /// /// </summary> /// <param name="userid"></param> /// <param name="name"></param> /// <param name="description"></param> /// <returns></returns> public async Task <string> CreateProject(long userid, string name, string description) { string functionName = "create-project"; string entityName = "project"; addtionalPath = @"request-json"; string url = Broker.Server + "/" + pathToApi + entityName + "/" + functionName + "/" + addtionalPath + "/"; string json = "{\"userid\":" + userid + ",\"name\":\"" + name + "\",\"description\":\"" + description + "\"}"; string encodedParameters = WebServiceHelper.Encode(json); return(await BasicWebService.Call(url, Broker.UserName, Broker.Password, encodedParameters)); }
public async Task <string> UpdateResearchObject(long researchobjectid, string name, string description, XmlDocument extendedData, List <string> authornames) { string functionName = "update-research-object"; string entityName = "researchobject"; string url = Broker.Server + "/" + pathToApi + entityName + "/" + functionName /* + "/" + addtionalPath + "/"*/; GFBIOResearchObjectUpdateJSON researchObject = new GFBIOResearchObjectUpdateJSON(); researchObject.researchobjectid = researchobjectid; researchObject.name = name; researchObject.description = description; researchObject.extendeddata = extendedData; researchObject.authornames = authornames.ToList(); string json = "[" + JsonConvert.SerializeObject(researchObject) + "]"; //string body = WebServiceHelper.Encode(json); return(await BasicWebService.Call(url, Broker.UserName, Broker.Password, "", json)); }