I'm going based on this: https://airtable.com/developers/web/api/create-comment
The authorization is fine, but for some reason within scripting it keeps giving the error that the body isn't parsable. My script is as follows:
//Variables
let inputConfig = input.config();
let recordID = inputConfig.recordID;
let commentContent = "Hello World";
let url = 'https://api.airtable.com/v0/appksePpf16d6MPdp/tbl4ZEftsWgo84Ldu/' + recordID + '/comments';
console.log(commentContent);
//Create the Comment
let response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Bearer [private]',
'Content-Type': 'application/json',
},
body: { //For some reason, it's not accepting this body
'text': commentContent
}
});
console.log(await response.text());
//console.log(await response.json());
I've gotten it to work with this exact same data in Spectator, so I'm really puzzled as to why this doesn't work.
