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

ParameterTypeDescription
$idstringThe id of the File to download
$formatstringCSV or Excel (xlsx)
$directorystringOptional The directory to save the download to. The file's
original name will be preserved. Defaults to a local temporary directory.
returnsSplFileObjectThe 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;