public int GetUserID(string apiKey) { var request = ConstructRedmineRequest(RedmineUrlManager.GetCurrentUserUrl(), apiKey); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(response.GetResponseStream())) { string json = reader.ReadToEnd(); var userInfo = Parser.ParseCurrentUserResult(json); return(userInfo.user.id); } } }