$baseApiUrl = 'https://api.airtable.com/v0';
$baseId = 'baseIdAsFromAirtable';
$tableName = 'tableNameAsFromAirtable';
$apiKey = 'apiKeyAsFromYourAirtableAccount';
$response = Remote::get($baseApiUrl . '/'. $baseId . '/ ' .$tableName . '?api_key=' . $apiKey);
if ( $response->code() === 200 ) {
$results = $response->json()['records']; // or `$results = $response->json(false)->records` if you prefer working with an object
dump($results);
}
The important thing to note here is that in this case, it’s not results but records. What you have to query from your API, depends on the API, therefore it is important to know what your API request returns. A REST client (either as a stand alone app or a browser plugin) helps to examine the API response.
for the single items. If you want to fetch all urls into an array or so, you would have to loop through $air->testo->Imm.
Don’t know if 0 works here, I usually work with an array instead of object.
Hi,
I’ve followed everything there + docs from the main website. But I still get an error “Undefined property: stdClass::$Name” from datas within “fields”.