PHP¶
The SeaTable PHP Client encapsulates the SeaTable REST API. It is auto-generated from the public OpenAPI specification, which ensures all API endpoints are covered automatically.
- Source code on GitHub
- Package on Packagist
- Complete endpoint documentation in the API Reference
Installation¶
Authentication¶
Most operations on base data require a Base Token. You obtain it by exchanging an API Token, which can be generated in the SeaTable web interface:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = SeaTable\Client\Configuration::getDefaultConfiguration()
->setAccessToken('YOUR_API_TOKEN');
$apiInstance = new SeaTable\Client\Auth\BaseTokenApi(
new GuzzleHttp\Client(), $config
);
$result = $apiInstance->getBaseTokenWithApiToken();
$baseToken = $result['access_token'];
$baseUuid = $result['dtable_uuid'];
Account-level operations
For operations like listing bases or getting user info, authenticate with an Account Token instead of an API Token. An Account Token identifies a user and gives access to all their bases. See the API docs for how to obtain one.