When attempting to use the PATCH
method in Google Apps Script , I get an error INVALID_REQUEST_UNKNOWN
.
I’m able to do a POST
and GET
request. Tested my credentials using CURL and this worked. Tried the “HTTP Override” hack and that did not work.
function postToAirtable() {
var url = 'https://api.airtable.com/v0/appxs9P0mXsqcXs5R/Outreach';
var data = {
'fields': {
'Task': '<Task Name>',
'Outreacher': '<Person>',
'Month': 'May ',
'Status': 'In Progress',
'Go Live Date': '2016-03-01',
'Copy Card Link': [
'recONM5ul2oaG6yKi'
],
'Label': 'DET'
}
};
var headers = {'Authorization':'Bearer ' + '<API KEY>'};
var options = {
'contentType':'application/json',
'method' : 'PATCH',
'headers': headers,
// Convert the JavaScript object to a JSON string.
'payload' : JSON.stringify(data),
};
//Logger.log(options);
Logger.log(UrlFetchApp.fetch(url, options));
};