Currently in REST API - Airtable for my base, I see this in description for creating a record:
Your request body should include an array of up to 10 record objects. Each of these objects should have one key whose value is an inner object containing your record's cell values, keyed by either field name or field id.
But when I use this code:
table.create([{
"key": { "id": "45673157744282"},
"fields": {
"purchase_date": "2022-01-08T01:49:22Z",
"orderID": "155-5041239-4465010",
"order_status": "Shipped",
"sales_channel": "Amazon.com",
// .....
}
},]).then(result => {
console.log("Result=", result);
}).catch(err => console.log("Error=", err));
I get this error:
AirtableError {
error: 'INVALID_REQUEST_UNKNOWN',
message: 'Invalid request: parameter validation failed. Check your request data.',
statusCode: 422
So all I need to do is to be able to pass the key (id of the record to be created) while calling the .create().
How do I do it?