public IActionResult Template([FromQuery] TemplateRequest templateRequest)
        {
            // create a ReportingCloud object with stored API-Key
            ReportingCloud rc = new ReportingCloud(RCSettings.APIKey);

            // download document from ReportingCloud template storage
            byte[] document = rc.DownloadTemplate(templateRequest.TemplateName);

            // return Base64 string version
            return(new OkObjectResult(Convert.ToBase64String(document)));
        }
        public void DownloadTemplateTest()
        {
            try
            {
                ReportingCloud rc = new ReportingCloud(sUsername, sPassword, uriBasePath);

                // upload local test document
                byte[] bDocument     = File.ReadAllBytes("documents/invoice.tx");
                string sTempFilename = "test" + Guid.NewGuid().ToString() + ".tx";
                rc.UploadTemplate(sTempFilename, bDocument);

                // download document
                byte[] bTemplate = rc.DownloadTemplate(sTempFilename);

                // compare documents
                Assert.IsNotNull(bTemplate);

                rc.DeleteTemplate(sTempFilename);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }