PHP code example of fond-of / php-airtable-sdk

1. Go to this page and download the library: Download fond-of/php-airtable-sdk 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/ */

    

fond-of / php-airtable-sdk example snippets



FondOf\Airtable\{Table, Airtable};

$base = 'baseId';
$table = 'tableId';

$client = (new Airtable([
   'apiKey' => '1234567'
]))->createApiClient();

$table = new Table($client, $base, $table);

$record = $table->getRecord($recordId);

$records = $table->getRecords();

$fields = [
    'Name' => 'Foobar',
    'Notes' => 'This is an example',
    'Attachments' => [
        [
        'url' => 'https://foobar.jpg',
        'filename' => 'Example'
        ],
    ]
];

$table->writeRecord($fields);

$records = $table->limit(50)->getRecords();

$records = $table->base('baseId')->table('tableId')->getRecords();

$table = $table->setBase('baseId');
$table = $table->setTable('tableId');
$records = $table->getRecords();
bash
composer