Skip to main content

I’m struggling to find any docs of examples or returning a JSON packet of records from a module.export = function () {} block using the Airtable.js library;


Can someone point me in the right direction?

So I did this with Axios and it returns the result I’m after. How would I do this with Airtable.js?


module.exports = async function () {
return axios.get(
"https://api.airtable.com/v0/" + baseKey + "/Hours?view=Grid%20view",
{
headers: { Authorization: "Bearer " + apiKey }
}
).then( function ( response ) {
return response.data.records;
} ).catch( function ( error ) {
console.log( error );
} );
};

The Airtable API documentation has a section for the JavaScript library. It’s kind of hidden away, so you might have missed it:




Does that help?


Reply