Esempio n. 1
0
        public void InitializeMetricDataSources(int companyId)
        {
            if (_metricDataSources == null)
            {
                var metricDataSources = new List <MetricDataSource>();

                // Get each API that is integrated for this company
                foreach (var api in _externalApiAuthManager.GetExternalApiAuths(companyId).Select(a => a.ExternalApi).Distinct())
                {
                    var externalApimanager = _externalApiAuthManager.GetApiManager(api.Id);
                    metricDataSources.AddRange(externalApimanager.MetricDataSources());
                }
                _metricDataSources = metricDataSources;
            }
        }
Esempio n. 2
0
        public async Task <JsonResult> TestCredentials(string token, string key, int externalApiId)
        {
            var res = await _externalApiAuthManager.GetApiManager(externalApiId).TestCredentials(token, key, externalApiId);

            return(Json(new { success = true, result = res }));
        }