Currently working on fetching data from an API with Basic Authentication. Through this script: https://gist.github.com/anemitz/8cc6ef6c41ea4cefe51a13fbd6d8676a
function ImportJSONBasicAuthentication(url, query, parseOptions, username, password) {
var fetchOptions = {
"headers" : {
"Authorization" : 'Basic ' + Utilities.base64Encode(username + ':' + password)
},
muteHttpExceptions: true
};
return ImportJSONAdvanced(url, fetchOptions, query, parseOptions, includeXPath_, defaultTransform_);
}
Inserted the script to Google Script Editor (in Google Sheets) but when running the script the same error keeps coming back:
'ReferenceError: "ImportJSONAdvanced" is not defined. (line 10)'
In the actual sheet I am calling
=ImportJSONBasicAuthentication("url", "query", "noInherit, noTruncate", "api_key", )
Am I overlooking something here?