// Output is CSV or JSON public String GetLearningInstanceFieldlCassificationStatistics(Boolean RespInJsonFormat, String LearningInstanceID) { String Resp = ""; String Req = this.broker.RestEndpointURL + ":" + this.broker.RestAuthEndpointPort + "/IQBot/api/reporting/projects/" + LearningInstanceID + "/totals"; RestResponse MyResp = RestUtils.SendGetRequest(Req, this.broker.RestAuthToken, this.broker.IQBotMajorVersion); JsonObjects.LearningInstanceStats.Response r = JsonConvert.DeserializeObject <JsonObjects.LearningInstanceStats.Response>(MyResp.RetResponse); JsonObjects.LearningInstanceStats.Data LIData = r.data; Resp = "FieldName,RepresentationPercent" + "\n"; if (RespInJsonFormat) { Resp = MyResp.RetResponse; } else { List <JsonObjects.LearningInstanceStats.FieldRepresentation> FieldRep = LIData.classification.fieldRepresentation; //List<JsonObjects.LearningInstanceStats.Field> FieldAccuracy = LIData.accuracy.fields; foreach (JsonObjects.LearningInstanceStats.FieldRepresentation f in FieldRep) { String fName = f.name; int fRepPercent = f.representationPercent; Resp = Resp + fName + "," + fRepPercent + "\n"; } } return(Resp); }
// Output is CSV or JSON public String GetLearningInstanceStatistics(Boolean RespInJsonFormat, String LearningInstanceID) { String Resp = ""; String Req = this.broker.RestEndpointURL + ":" + this.broker.RestAuthEndpointPort + "/IQBot/api/reporting/projects/" + LearningInstanceID + "/totals"; RestResponse MyResp = RestUtils.SendGetRequest(Req, this.broker.RestAuthToken, this.broker.IQBotMajorVersion); JsonObjects.LearningInstanceStats.Response r = JsonConvert.DeserializeObject <JsonObjects.LearningInstanceStats.Response>(MyResp.RetResponse); JsonObjects.LearningInstanceStats.Data LIData = r.data; Resp = "Accuracy,TotalFilesProcessed,TotalSTP,TotalFilesUploaded,TotalFilesToValidation,TotalFilesValidated,TotalFilesUnprocessable,TotalStagingPageCount,TotalProdPageCount" + "\n"; if (RespInJsonFormat) { Resp = MyResp.RetResponse; } else { int accuracy = LIData.totalAccuracy; int totalFilesProcessed = LIData.totalFilesProcessed; int totalSTP = LIData.totalSTP; int totalFilesUploaded = LIData.totalFilesUploaded; int totalFilesToValidation = LIData.totalFilesToValidation; int totalFilesValidated = LIData.totalFilesValidated; int totalFilesUnprocessable = LIData.totalFilesUnprocessable; int totalStagingPageCount = LIData.totalStagingPageCount; int totalProductionPageCount = LIData.totalProductionPageCount; Resp = Resp + accuracy + "," + totalFilesProcessed + "," + totalSTP + "," + totalFilesUploaded + "," + totalFilesToValidation + "," + totalFilesValidated + "," + totalFilesUnprocessable + "," + totalStagingPageCount + "," + totalProductionPageCount + "\n"; } return(Resp); }