Mar 29, 2020 07:48 AM
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?
Mar 29, 2020 10:07 AM
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 );
} );
};
Apr 10, 2020 11:56 AM
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?