Help

Authentication for Personal Access Tokens not working!!!!

Topic Labels: Formulas
299 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Jay_P
7 - App Architect
7 - App Architect
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: 
Jay_P_0-1717632023714.png

 

○ 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