const myHeaders = {
'Content-Type': 'application/json',
'Authorization': 'Basic XXXXXX'
};
function findGongCallByDate(when) {
const raw = JSON.stringify( {
'contentSelector': {
'context': 'None',
'exposedFields': {
'collaboration': {
'publicComments': true
},
'content': {
'pointsOfInterest': true,
'highlights': true,
'callOutcome': true,
'keyPoints': true
},
'parties': true
}
},
'filter': {
'fromDateTime': '2024-10-18T07:00:00-08:00',
'toDateTime': '2024-10-21T09:00:00-08:00'
}
} );
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow",
muteHttpExceptions: true
};
var response = UrlFetchApp.fetch("https://api.gong.io/v2/calls/extensive", requestOptions);
console.log(response.toString());
}
function getAllGongCalls()
{
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
var response = UrlFetchApp.fetch("https://api.gong.io/v2/calls", requestOptions);
console.log(response.getContentText());
}
The above code has 2 functions.
-
getAllGongCalls - which works great.
-
findGongCallByDate - which fails with the below error
{"requestId":"1efp7ktsac4zd2g13el","errors":["Request message not readable"]}
Any idea what is wrong with it?