public string GetToken() { AuthApi authAPI = new AuthApi(ConnectionSettings.ServerURL); var apiResponse = authAPI.ApiV1AuthTokenPostWithHttpInfo(new LoginModel(ConnectionSettings.AgentUsername, ConnectionSettings.AgentPassword)); Configuration.AccessToken = apiResponse.Data.Token.ToString(); ConfigurationUpdatedEvent?.Invoke(this, Configuration); ConnectionSettings.AgentId = apiResponse.Data.AgentId; return(Configuration.AccessToken); }