Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 18, 2018 11:44
Show Gist options
  • Save bjoerntx/cf238a23f5a7c1422e91b7ed5e8c9fbb to your computer and use it in GitHub Desktop.
Save bjoerntx/cf238a23f5a7c1422e91b7ed5e8c9fbb to your computer and use it in GitHub Desktop.
[HttpGet]
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));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment