Comments (10)
Hi, can you post a picture of your table names? Airtable is very sensitive to table and column names.
from airtable-php.
those are the 2 tables that I'm trying to use
from airtable-php.
@cesantibanez were you able to fix the issue? The table names are fine. It looks like the client is not loading. If you can't make it work, I'm available today to help you. Let me know.
from airtable-php.
I am having this issue as well.
This returns NULL:
$airtable = new Airtable(array(
'api_key' => 'keyasdf',
'base' => 'appasdf'
));
$request = $airtable->getContent( 'Open' );
do {
$response = $request->getResponse();
var_dump( $response[ 'records' ] );
}
while( $request = $response->next() );
print_r($request);
from airtable-php.
This ended up being an issue with my local dev environment curl settings. I suspect this is the same issue @cesantibanez is having.
This fixed it for me: https://stackoverflow.com/a/31830614
from airtable-php.
Thanks for sharing what fixed it for you @cy-josh !
@cesantibanez , were you able to fix it?
from airtable-php.
I'm getting the same: NULL
What's wrong?
<?php
// if not using composer, uncomment this
include('airtable-php-2.2.9/src/Airtable.php');
include('airtable-php-2.2.9/src/Request.php');
include('airtable-php-2.2.9/src/Response.php');
use TANIOS\Airtable\Airtable;
$airtable = new Airtable(array(
'api_key' => 'pat3xxxxxxxxxxxxxx',
'base' => 'appHpxxxxxxxxxxxxxx',
));
$request = $airtable->getContent('Corporate CMS');
do {
$response = $request->getResponse();
var_dump($response['records']);
} while ($request = $response->next());
?>
I'm running my project with the PHP Built-in server: php -S project.test:4000
I tried what @cy-josh linked above but didn't work. Please share exactly how you solved.
Thanks
from airtable-php.
@dangelion - 👋
Airtable deprecated the API keys for authentication. They moved to a personal token system
https://airtable.com/developers/web/guides/personal-access-tokens
This is how I've been accessing results ...
$ch = curl_init([url]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer '.[access_token]
));
$result = curl_exec($ch);
If you need help designing a URL to submit this is a good resource - https://codepen.io/airtable/full/MeXqOg
from airtable-php.
Hi @leepettijohn thanks for answer! I never did it like that. So in you way you're not using the library of this Github?
Could you post a real world code example? There's Airtable documentation about that way?
from airtable-php.
Let me know if this helps.
<?php
/*
// to see an example of how a URL should look when all the parameters are used - Airtable API encoder - https://codepen.io/airtable/full/MeXqOg
// REQUIRED
// Find Access Tokens here - https://airtable.com/create/tokens
// Find base here - https://airtable.com/api
$acctoken = '___';
$baseid = '___';
// I believe I used this template - https://www.airtable.com/universe/expn38xdYZDKzzTqX/the-best-furniture-planner
$tablename = 'Furniture';
$tableview = 'All furniture';
//Get results from AT
$url = 'https://api.airtable.com/v0/'.$baseid.'/'.$tablename.'?view='.$tableview;
$ch = curl_init(encodeUrl($url));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer '.$acctoken
));
$result = curl_exec($ch);
print_r($result);
?>
from airtable-php.
Related Issues (20)
- Ability to enable typecast HOT 1
- Check if Airtable is down HOT 1
- Is there a way to add new column to table if not available? HOT 1
- Help - Multiple column search HOT 1
- PHP 8.1 compatibility (ReturnTypeWillChange) HOT 3
- Hey, there is a critical error. HOT 1
- Date field error! HOT 1
- how to append new record id to an existing field using your library HOT 1
- Please merge typecast PR HOT 2
- Add some degree of error handling HOT 1
- What does this error mean?
- Early heads up: switching away from user API keys HOT 4
- Accelerated need to limit large url requests to “list records”, with alternative POST version
- Not all records returned HOT 7
- Comment on Token HOT 2
- How to get specific fields only using formula?
- getting data from a table with "/" character in name
- new API authentication methods HOT 2
- How to add multiple conditions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airtable-php.