Hi everyone! I've recently started using Airtable and absolutely love it ❤️
However, I'm getting an error while trying to use the PATCH request to update a field in my table.
My code is shown below:
UrlFetchApp.fetch('https://api.airtable.com/v0/' + baseID + '/' + tableID + '/' + recordID, {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + api_key,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"fields": {
"OpenAI_key": userApiKey
}
})
});
Error message:
Exception: Request failed for https://api.airtable.com returned code 422. Truncated server response: {"error":{"type":"INVALID_REQUEST_MISSING_FIELDS","message":"Could not find field \\"fields\\" in the request body"}} (use muteHttpExceptions option to examine full response)
Any help will be appreciated
Thanks!