Download a Data Table
Download a Data Table as a CSV or Excel (xlsx) file.
Permissions Required
You must have permissions to read the Data Table for this request to succeed.
Method Signature
FileInfo Download(Guid id, DataTableExportFormat format, DirectoryInfo directory = null);
async Task<FileInfo> DownloadAsync(Guid id, DataTableExportFormat format, DirectoryInfo directory = null);
Parameters
Parameter | Type | Description |
---|---|---|
id | Guid | The id of the Data Table to download |
format | DataTableExportFormat | CSV or Xlsx (Excel) |
directory | DirectoryInfo | Optional The directory to save the download to. The file's original name will be preserved. Defaults to a local temporary directory. |
returns | FileInfo | A reference to the downloaded file |
FileInfo Download(string id, DataTableExportFormat format, DirectoryInfo directory = null);
async Task<FileInfo> DownloadAsync(string id, DataTableExportFormat format, DirectoryInfo directory = null);
Parameter | Type | Description |
---|---|---|
id | string | The id of the Data Table to download |
format | DataTableExportFormat | CSV or Xlsx (Excel) |
directory | DirectoryInfo | Optional The directory to save the download to. The Data Table's name will be preserved used as the file name. Defaults to a local temporary directory. |
returns | FileInfo | A reference to the downloaded file |
FileInfo Download(Guid id, DataTableExportFormat format, FileInfo file);
async Task<FileInfo> DownloadAsync(Guid id, DataTableExportFormat format, FileInfo file);
Parameter | Type | Description |
---|---|---|
id | Guid | The id of the Data Table to download |
format | DataTableExportFormat | CSV or Excel (xlsx) |
file | FileInfo | The file name and path to save the download to. |
returns | FileInfo | A reference to the downloaded file |
FileInfo Download(string id, DataTableExportFormat format, FileInfo file);
async Task<FileInfo> DownloadAsync(string id, DataTableExportFormat format, FileInfo file);
Parameter | Type | Description |
---|---|---|
id | string | The id of the Data Table to get a readable stream of |
format | DataTableExportFormat | CSV or Excel (xlsx) |
file | FileInfo | The file name and path to save the download to. |
returns | FileInfo | A reference to the downloaded file |
Example
/*
* This example demonstrates downloading a Data Table
*/
using Catalytic.Sdk.Entities;
namespace Catalytic.Sdk.Examples
{
class Program
{
static void Main(string[] args)
{
var catalytic = new Catalytic.Sdk.CatalyticClient(Credentials.Default);
var file = catalytic.DataTables.Download("8d20bdf5-d3bb-4a08-b05b-eb22a8b5c300");
Console.WriteLine($"DataTable downloaded to {file.FullName}");
}
}
}
Updated about 3 years ago