// Probably can limit return type later, but returning full HttpResponse for now // for more flexiblity. I want to have logic based on the StatusCode within the // HttpResponseMessage. Could handle that here later. public HttpResponseMessage AddMeet(Meet meet) { string jsonMeetObj = JsonConvert.SerializeObject(meet); var response = FieldScribeAPIRequests.POSTJsonWithTokenAsync( jsonMeetObj, "meets", TokenManager.Instance.Token); return(response); }
public HttpResponseMessage DeleteMeet(Meet meet) { int meetId = meet.MeetId; var response = FieldScribeAPIRequests.POSTJsonWithTokenAsync( "", "meets/" + meet.MeetId + "/delete", TokenManager.Instance.Token); return(response); }
public bool RemoveScribe( int meetId, Guid userId, string token) { HttpResponseMessage response = FieldScribeAPIRequests .POSTJsonWithTokenAsync(JsonConvert.SerializeObject( new AssignScribeForm { UserId = userId, MeetId = meetId }), "users/remove", token); if (response.StatusCode == System.Net.HttpStatusCode.OK) { return(true); } return(false); }
public (bool, IList <User>) GetScribes(string[] searchTerms, string token) { string jsonObject = JsonConvert.SerializeObject( new SearchTermsForm { SearchTerms = searchTerms }); HttpResponseMessage response = FieldScribeAPIRequests .POSTJsonWithTokenAsync(jsonObject, "users/scribes?orderBy=lastName", token); if (response.StatusCode == System.Net.HttpStatusCode.OK) { return(true, HttpToList(response)); } return(false, null); }
public (bool, string) RegisterScribe(RegisterForm form, string token) { HttpResponseMessage response = FieldScribeAPIRequests .POSTJsonWithTokenAsync(JsonConvert.SerializeObject( form), "users/scribe", token); if (response.StatusCode == System.Net.HttpStatusCode.Created) { return(true, "Scribe successfully added"); } if (response.StatusCode == System.Net.HttpStatusCode.Conflict) { return(false, "User with email " + form.Email + " already exists"); } return(false, "Registration failed. Try again."); }