Skip to content

cremadesign/airtable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Airtable Caching API

by Stephen Ginn at Crema Design Studio

This PHP script checks for the existence of a cache file. If one doesn't exist, it connects to Airtable and saves a new one.

Installation

You can install the package via composer:

composer config repositories.crema/airtable git https://github.com/cremadesign/airtable
composer require crema/airtable:@dev

Define airtables account information in config.json:

{
	"airtable": {
		"api_key": "YOUR_API_KEY",
		"base_id": "YOUR_BASE_ID"
	}
}

Usage

Add this code to your PHP file:

require_once '../vendor/autoload.php';

use Crema\Airtable;

$credentials = json_decode(file_get_contents('../config.json'))->airtable;
$airtable = new AirTable($credentials);
$records = $airtable->getTable('YOUR_TABLE_NAME');

header('Content-Type: application/json');
echo json_encode($records, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);

About

Airtable API Wrapper for PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages