Hi I’m trying to access the Public Data API via Google Apps Script. Every time I run the code the following message appears: “error”:“Empty Authorization header”,“type”:“ch:service” I’m not sure where I’m going wrong, I’d appreciate it if anyone had any advice.
Here’s my code:
function run () {
var options = {
‘Authorization’: ‘Basic’,
‘ApiKey’: ‘46bd176e-b8ac-4fcc-xxxx-xxxxxxxxxx:’
};
var url = ‘https://api.company-information.service.gov.uk/company/11291018’;
var response = UrlFetchApp.fetch(url,options);
var result = JSON.parse(response.getContentText());
Logger.log(JSON.stringify(result, null, 2));
}