Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 05, 2024 05:02 PM
const Airtable = require('airtable');
const airtable = new Airtable({
apiKey: 'patMH--changed--FEQXBB4',
});
// Replace with your Airtable base ID
const baseId = 'appM0aa--changed--DFmhzwJv6w';
// Replace with the table name you want to access
const tableName = 'home_first';
airtable.base(baseId)(tableName)
.select({
filterByFormula: '{RECORD_ID() <= 5}', // Filter to get the first 5 records
maxRecords: 5, // Limit to 5 records
})
.firstPage((err, records) => {
if (err) { console.error(err); return; }
records.forEach((record) => {
console.log(record.fields); // Access record data using record.fields object
});
});
I keep getting the following error:
â—‹ node one.js
AirtableError {
error: 'AUTHENTICATION_REQUIRED',
message: 'You should provide valid api key to perform this operation',
statusCode: 401
}
Yes, I have given full permission in the scope to access the base and the read and write permissions.
0 Replies 0
