I am getting the error 'Exception: Request failed for https://api.pipedrive.com returned code 404. Truncated server response: {"status":false,"error":"Unknown method ."} (use muteHttpExceptions option to examine full response)' when attempting a put/post request to a Pipedrive deal. (Date Field) Below is the function producing the error. I am pretty sure this is something obvious but have not been able to determine the cause on my own. Any help would be appreciated.
function Update_pipedrive_Date(dealid, field_name){
var todays_date = Utilities.formatDate(new Date(), "GMT-5", "yyyy-MM-dd"); // "yyyy-MM-dd'T'HH:mm:ss'Z'"
var url = 'https://api.pipedrive.com/v1/deals/' + dealid + '?api_token='+oys_api_key
var data = {field_name: todays_date};
var options = {
'method': 'post',
'contentType': 'application/json',
'payload': JSON.stringify(data)
};
var response = UrlFetchApp.fetch(url, options);
return response
}
def update_field(this_dealid, fieldid):
tday = now.strftime("%Y-%m-%d")
headers = {'content-type': 'application/json'}
updates = {fieldid: tday}
resp = requests.put(
'https://api.pipedrive.com/v1/deals/' + str(
this_dealid) + '?api_token=' + api_key,
data=json.dumps(updates), headers=headers)
return resp