I just can’t find the right way to format my request. I’m trying to update a single field in a single record. but keep hitting - INVALID_REQUEST_MISSING_FIELDS",“message”:"Could not find field “fields” in the request body
Getting data is fine.
After a few hours trying different things I’m asking for help what am I missing? Any help appreciated
API and Base ID Blanked out
function apiCall(){
var API_KEY = ‘XXXXXXXXX’;
var root = ‘https://api.airtable.com/v0’;
var baseId = ‘XXXXXXXXXXXX’;
var tableName = encodeURIComponent(‘Travels’);
var recordId = “recSaJTXSBu1g8CBd”
var endpoint = ‘/’ + baseId + ‘/’ + tableName + ‘/’ + recordId;
var params = {
‘method’: ‘PATCH’,
‘muteHttpExceptions’: true,
‘Content-Type’: ‘application/json’,
‘headers’: {
‘Authorization’: 'Bearer ’ + API_KEY
},
"fields" : {
"Declaration link": "https://docs.google.com/spreadsheets/d/13V8gO7511yJ0830IpiKXtfYfKeuVVSJ8uqbXR-9Ne8w/edit#gid=0"
}
};
var response = UrlFetchApp.fetch(root + endpoint, params);
Logger.log(response.getContentText());
}