My goal is to get Airtable to return a complete list of fields from a table. However, Airtable has a limitation in its normal API where it does not return a field if there’s no data in it for that particular record; it only returns the fields that are populated.
The limitation was mentioned here: Retrieve column names via API - #2 by dillingham - API - Airtable Community Forum
It was suggested in the Airtable forum that you could get a list of fields using the metadata API.
See: Sign in - Airtable
I was wondering if n8n already had a way to tap in to that, and that perhaps I’m just missing it. Does anybody know?
This command example from the link above would be useful if I could run it in a function somehow:
Maybe somebody has a pointer on that?
Or maybe I’ll have to get in to node editing which I’ve not tried yet.
Thanks in advance for any tips you might have!
You should be able to do this using the
Thank you! That could be helpful. I’m not sure what option to pick regarding the HTTP node’s authentication, or which option to pick when saving the API key in N8N’s credentials area. It doesn’t seem to fit the oauth schema. Do you know how that would work?
This is what they say about authentication:
The metadata API uses token-based authentication like Airtable’s standard REST API. Users will need to paste their Airtable account’s API key (available from your account page) into your integration. Send the API key in the Authorization header of all your requests:
Authorization: Bearer $USER_API_KEY
After you receive a client secret from us, you must send a
X-Airtable-Client-Secret HTTP header with all your requests to help us identify and authenticate your integration. If you fail to do this, your request will be blocked.
Enterprise Airtable accounts do not require a separate Metadata API client secret.
Finally, please perform all requests to these endpoints server-side. Client-side requests are not allowed because they would expose the user’s API token.
What you can do is use your existing AirTable credential in an http node like this:
Note you might need to add query paremeters etc - you’ll have to consult the AirTable API docs to figure out the proper way to build the HTTP request
EDIT: Updated my example to include the required header (you’ll need to replace the
$USER_API_KEY with your own obv)
Hope that helps,
I missed this key sentence in their API docs:
“If you want to develop an integration using the Metadata API, you must register here for access and to receive a client secret. Enterprise Airtable accounts do not require a separate Metadata API client secret.”
And so I went over there to do just that. And the notice on that page says:
“We’ve received an overwhelming interest in access to this metadata API. We are pausing creating new tokens for the time being as we iron out our infrastructure, monitoring, and policies here.”
I guess I submit and wait. I suppose this wasn’t a crucial task at the moment anyway.
Thank you for your help!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.