private void TestRoles(ClientAuthTokenReceived obj) { MsgLogger.LogMsg("TestRoles!!"); var apiInstance = new UsersApi("https://auth.angusmf.com"); apiInstance.Configuration.AddDefaultHeader("Authorization", string.Format("Bearer {0}", obj.token)); try { var response = apiInstance.GetAllWithHttpInfo(); if (response.StatusCode == 200) { MsgLogger.LogMsg(string.Format("user count = {0}", response.Data.Count)); return; } else { MsgLogger.LogMsgError(string.Format("Error: Received response code {0} during GetAllWithHttpInfo", response.StatusCode)); } } catch (Exception e) { MsgLogger.LogMsgError("Exception when calling apiInstance.GetAllWithHttpInfo: " + e.Message); } }