PHP code example of guym4c / airtable-client

1. Go to this page and download the library: Download guym4c/airtable-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

guym4c / airtable-client example snippets


$airtable = new \Guym4c\Airtable\Airtable(/* YOUR API KEY */, /* YOUR BASE ID */);

$airtable->get($table, $recordId);
$airtable->create($table, $jsonArray);
$airtable->update($record /* more on this below */); // you may pass an additional boolean as TRUE for a destructive update
$airtable->delete($table, $recordId); // returns a boolean - whether deletion was successful

$myField = $record->field;

$relatedRecord = $record->field->load('relatedTable');

$airtable = new \Guym4c\Airtable\Airtable($apiKey, $baseId, $cache, ['cachable_table_one', 'cachable_table_two']);

public function __construct(
    string $key,
    string $baseId,
    ?CacheProvider $cache = null,
    array $cachableTables = [],
    ?string $apiEndpoint = null,
    array $headers = [],
    bool $isRateLimited = true
) {