| private static bool Enroll(string dna, string typingId) |
| { |
| TypingEnrolViewModel request = new TypingEnrolViewModel(); |
| request.samples = new List<string>(); |
| |
| request.user_id = typingId; |
| request.samples.Add(dna); |
| |
| string jsonObject = new JavaScriptSerializer().Serialize(request); |
| |
| HttpResponse<String> response = Unirest.post("https://api.keytrac.net/anytext/enrol") |
| .header("Authorization", "XXXXX") |
| .header("Content-Type", "application/json") |
| .body(jsonObject) |
| .asJson<String>(); |
| |
| |
| var result = response.Body; |
| var results = JsonConvert.DeserializeObject<TypingViewModel>(response.Body); |
| |
| return results.OK; |
| } |