Example #1
0
        static void Main(string[] args)
        {
            String endpoint = "http://secxbrl.28.io/v1/_queries/public";
              CellStore.Api.DataApi dataAPI = new CellStore.Api.DataApi(endpoint);

              String token = "c3049752-4d35-43da-82a2-f89f1b06f7a4";
              // login .. Alternative step to create a token dynamically
              /*
            CellStore.Api.SessionsApi sessionsAPI = new CellStore.Api.SessionsApi(endpoint);
            dynamic loginResponse = sessionsAPI.Login("*****@*****.**", "password");
            String token = loginResponse["token"];
              */

              string factTxt = System.IO.File.ReadAllText(@"..\..\fact.json");
              Console.WriteLine("Fact = {0}", factTxt);
              dynamic fact = JsonConvert.DeserializeObject(factTxt);

              // add a fact
              dynamic addResponse = dataAPI.AddFacts(token, fact);
              Console.WriteLine("=============================");
              Console.WriteLine("Response:");
              Console.WriteLine(addResponse);

              Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            String endpoint = "http://secxbrl.28.io/v1/_queries/public";
              CellStore.Api.DataApi dataAPI = new CellStore.Api.DataApi(endpoint);

              String token = "c3049752-4d35-43da-82a2-f89f1b06f7a4";
              // login .. Alternative step to create a token dynamically
              /*
            CellStore.Api.SessionsApi sessionsAPI = new CellStore.Api.SessionsApi(endpoint);
            dynamic loginResponse = sessionsAPI.Login("*****@*****.**", "password");
            String token = loginResponse["token"];
              */

              pepVsCocaColaFacts(dataAPI, token);
              attFacts(dataAPI, token);
              cocaColaFacts(dataAPI, token);
        }
        public ListFactsTask(
            Object basePath,
            Object token,
            Parameters parameters,
            Object debugInfo
            )
        {
            basePath_casted = Utils.castParamString(basePath, "basePath", false, "http://secxbrl.28.io/v1/_queries/public");
            api             = ApiClients.getDataApiClient(basePath_casted);

            token_casted               = Utils.castParamString(token, "token", true);
            eid_casted                 = Utils.castParamString(parameters.getParamValue("eid"), "eid", false);
            ticker_casted              = Utils.castParamString(parameters.getParamValue("ticker"), "ticker", false);
            tag_casted                 = Utils.castParamString(parameters.getParamValue("tag"), "tag", false);
            aid_casted                 = Utils.castParamString(parameters.getParamValue("aid"), "aid", false);
            fiscalYear_casted          = Utils.castParamString(parameters.getParamValue("fiscalYear"), "fiscalYear", false);
            concept_casted             = Utils.castParamString(parameters.getParamValue("concept"), "concept", false);
            fiscalPeriod_casted        = Utils.castParamString(parameters.getParamValue("fiscalPeriod"), "fiscalPeriod", false);
            fiscalPeriodType_casted    = Utils.castParamString(parameters.getParamValue("fiscalPeriodType"), "fiscalPeriodType", false);
            report_casted              = Utils.castParamString(parameters.getParamValue("report"), "report", false);
            additionalRules_casted     = Utils.castParamString(parameters.getParamValue("additionalRules"), "additionalRules", false);
            open_casted                = Utils.castParamBool(parameters.getParamValue("open"), "open", false);
            aggregationFunction_casted = Utils.castParamString(parameters.getParamValue("aggregation-function"), "aggregationFunction", false);
            profileName_casted         = Utils.castParamString(parameters.getParamValue("profile-name"), "profileName", false);

            dimensions_casted           = parameters.getDimensionsValues();
            dimensionDefaults_casted    = parameters.getDimensionDefaultsValues();
            dimensionTypes_casted       = parameters.getDimensionTypesValues();
            dimensionAggregation_casted = parameters.getDimensionAggregationsValues();

            count_casted = Utils.castParamBool(parameters.getParamValue("count"), "count", false);
            top_casted   = Utils.castParamInt(parameters.getParamValue("top"), "top", 100);
            //skip_casted = Utils.castParamInt(skip, "skip", 0);

            debugInfo_casted = Utils.castParamBool(debugInfo, "debugInfo", false);

            if (!(Utils.hasEntityFilter(eid_casted, ticker_casted, tag_casted, dimensions_casted) &&
                  Utils.hasConceptFilter(concept_casted, dimensions_casted) &&
                  Utils.hasAdditionalFilter(fiscalYear_casted, fiscalPeriod_casted, dimensions_casted)))
            {
                throw new Exception("Too generic filter.");
            }
            //Utils.log("Created Task " + ToString());
        }
Example #4
0
        public ListFactsTask(
            Object basePath,
            Object token,
            Parameters parameters,
            Object debugInfo
          )
        {
            basePath_casted = Utils.castParamString(basePath, "basePath", false, "http://secxbrl.28.io/v1/_queries/public");
            api = ApiClients.getDataApiClient(basePath_casted);

            token_casted = Utils.castParamString(token, "token", true);
            eid_casted = Utils.castParamString(parameters.getParamValue("eid"), "eid", false);
            ticker_casted = Utils.castParamString(parameters.getParamValue("ticker"), "ticker", false);
            tag_casted = Utils.castParamString(parameters.getParamValue("tag"), "tag", false);
            aid_casted = Utils.castParamString(parameters.getParamValue("aid"), "aid", false);
            fiscalYear_casted = Utils.castParamString(parameters.getParamValue("fiscalYear"), "fiscalYear", false);
            concept_casted = Utils.castParamString(parameters.getParamValue("concept"), "concept", false);
            fiscalPeriod_casted = Utils.castParamString(parameters.getParamValue("fiscalPeriod"), "fiscalPeriod", false);
            fiscalPeriodType_casted = Utils.castParamString(parameters.getParamValue("fiscalPeriodType"), "fiscalPeriodType", false);
            report_casted = Utils.castParamString(parameters.getParamValue("report"), "report", false);
            additionalRules_casted = Utils.castParamString(parameters.getParamValue("additionalRules"), "additionalRules", false);
            open_casted = Utils.castParamBool(parameters.getParamValue("open"), "open", false);
            aggregationFunction_casted = Utils.castParamString(parameters.getParamValue("aggregation-function"), "aggregationFunction", false);
            profileName_casted = Utils.castParamString(parameters.getParamValue("profile-name"), "profileName", false);

            dimensions_casted = parameters.getDimensionsValues();
            dimensionDefaults_casted = parameters.getDimensionDefaultsValues();
            dimensionTypes_casted = parameters.getDimensionTypesValues();
            dimensionAggregation_casted = parameters.getDimensionAggregationsValues();

            count_casted = Utils.castParamBool(parameters.getParamValue("count"), "count", false);
            top_casted = Utils.castParamInt(parameters.getParamValue("top"), "top", 100);
            //skip_casted = Utils.castParamInt(skip, "skip", 0);

            debugInfo_casted = Utils.castParamBool(debugInfo, "debugInfo", false);

            if (!(Utils.hasEntityFilter(eid_casted, ticker_casted, tag_casted, dimensions_casted)
                && Utils.hasConceptFilter(concept_casted, dimensions_casted)
                && Utils.hasAdditionalFilter(fiscalYear_casted, fiscalPeriod_casted, dimensions_casted)))
            {
                throw new Exception("Too generic filter.");
            }
            //Utils.log("Created Task " + ToString());
        }
Example #5
0
        static void Main(string[] args)
        {
            String endpoint = "http://secxbrl.28.io/v1/_queries/public";
              CellStore.Api.DataApi dataAPI = new CellStore.Api.DataApi(endpoint);

              String token = "example-token";
              // login .. Alternative step to create a token dynamically
              /*
            CellStore.Api.SessionsApi sessionsAPI = new CellStore.Api.SessionsApi(endpoint);
            dynamic loginResponse = sessionsAPI.Login("*****@*****.**", "password");
            String token = loginResponse["token"];
              */

              byte[] archive = File.ReadAllBytes(@"filing.zip");

              dynamic result = dataAPI.AddArchives(token: token, archive: archive, contentType: "application/xbrlx", profileName: "SEC");

              Console.WriteLine(JsonConvert.SerializeObject(result));
              Console.ReadKey();
        }