wrote a function to call knack api to request records but I can't find a way to parses the response object
I tried to use .getContextText() from appscript but it throw error saying it's not a function
function getKnackRecords(objID, filter, sortObj, recordID) {
let options ={
method: 'GET',
headers: headers
}
if(typeof filter !=='undefined'){
api_url += '?filters=' + encodeURIComponent(JSON.stringify(filter)) + '&sort_field=' + sortObj.field + '&sort_order=' + sortObj.order
}else{
api_url += '/' + recordID
}
let response = fetch(api_url, options);
let data =JSON.parse(response.getContextText())
console.log(data)
return data
}