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
download(string $id, string $format, string $directory = null): SplFileObject
Parameters
Parameter | Type | Description |
---|---|---|
$id | string | The id of the File to download |
$format | string | CSV or Excel (xlsx) |
$directory | string | Optional The directory to save the download to. The file's original name will be preserved. Defaults to a local temporary directory. |
returns | SplFileObject | The downloaded Data Table |
Example
<?php
/*
* This example demonstrates downloading a DataTable
*/
require_once(__DIR__ . '/vendor/autoload.php');
use Catalytic\SDK\CatalyticClient;
$catalytic = new CatalyticClient();
$file = $catalytic->dataTables()->download('7e77254c-d2d6-4271-965a-98390aefa50a', 'csv');
echo "DataTable downloaded to " . $file->getPathname() . PHP_EOL;
Updated almost 3 years ago