Skip to main content

Hello!
I am getting error while requesting api - using your javascript example

var Airtable = require('airtable'); 
var base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('XXXXXXXXXXXXXXX');
base(
'Settings').find('recKrP4fJsCmnavbd', function(err, record) {
if (err) { console.error(err); return; }
console.log('Retrieved', record.id); });

GET https://api.airtable.com/v0/undefined/Settings/recKrP4fJsCmnavbd? 404
AirtableError {error: 'NOT_FOUND', message: 'Could not find what you are looking for', statusCode: 404}







Could you please share more details about where and how you're trying to use this code? The code itself isn't providing any clues as to the source of the problem.


Could you please share more details about where and how you're trying to use this code? The code itself isn't providing any clues as to the source of the problem.


I got the code from the Airtalbe Help API.
I want to use this code on a React website in order to read the data.
I have a problem from the very beginning - the API returns an error.


I got the code from the Airtalbe Help API.
I want to use this code on a React website in order to read the data.
I have a problem from the very beginning - the API returns an error.


"the very beginning" meaning the first line of the code that you posted? If so, that's likely an indicator that the environment where the React code is running isn't on a Node.js server. The require() function will only work when running the script on a Node.js server. On top of that, you would need to install the "airtable.js" module onto the server from the link provided in the API docs.


"the very beginning" meaning the first line of the code that you posted? If so, that's likely an indicator that the environment where the React code is running isn't on a Node.js server. The require() function will only work when running the script on a Node.js server. On top of that, you would need to install the "airtable.js" module onto the server from the link provided in the API docs.


Thank you, Justin.
Today I found confirmation of your remark in the video on YouTube - but I did not have time to check it. I think everything will work fine now.


Reply