Help

Create record with provided JS not working

Topic Labels: API
719 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Derek_Redmond
4 - Data Explorer
4 - Data Explorer

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