When attempting to make a POST request using Google Apps Script, I encountered the error message: 'Passed parameter type mismatch: 'fields''.
I attempted to resolve this issue by adding JSON.stringify(requestBody)
to the payload, however, this solution did not work. What could be causing this problem?
var fields = ["id","name","group_name"]
var requestBody = {
"project_id": "3259344",
"fields": fields,
"limit": "30"
}
var options =
{
'method' : 'POST',
'headers' : {
'User-Id' : email,
'Authorization' : 'Bearer '+ apiKey
},
'payload' : requestBody
};
var response = UrlFetchApp.fetch("https://api.test.com/v2/json/get/keywords", options);