private async Task <string> GetApiToken(string username, string password, string deviceId, string deviceDescription) { var postParams = new Dictionary <string, string> { { "username", username }, { "password", password }, { "deviceId", deviceId }, { "deviceDescription", deviceDescription } }; var response = await HttpRequest.Post(EndPointHelper.GetLoginUserPassURL(), postParams); string token = await response.Content.ReadAsStringAsync(); if (!response.IsSuccessStatusCode || String.IsNullOrEmpty(token)) { throw new Exception("Login Failed"); } else { return(token); } }