Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Create record with provided JS not working

Topic Labels: API
404 0
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello,

I’m using postman to create records in a table with data coming from another system. I am trying to use the JavaScript code provided in the API documentation (see below), however I’m getting the below error. Any help would be appreciated. Thanks!

Error
{
“error”: {
“type”: “INVALID_REQUEST_MISSING_FIELDS”,
“message”: “Could not find field “fields” in the request body”
}
}

JavaScript provided in API Docs
var Airtable = require(‘airtable’);
var base = new Airtable({apiKey: ‘removed’}).base(‘removed’);

base(‘Table1’).create({
“Session_Title”: “test”,
“Timestamp”: “tes”,
“Duration”: “test”,
“Coach_Emp_ID”: “test”
}, function(err, record) {
if (err) {
console.error(err);
return;
}
console.log(record.getId());
});

0 Replies 0