Hi there, I have tried reading every search result about this error but haven’t been able to get any response from the API. If anyone could help, I would be most grateful:
var compprofile = 'https://api.companieshouse.gov.uk/company/';
var company = '00048839'; // barclays bank
var url = compprofile + company;
var key = 'xxxxxxxxxxx-yyyyyyyy-zzzzzzzzzz:'; //removed but have been using trailing colon
var headers = new Headers ({
'Authorization': 'Basic ' + btoa(key),
'Content-Type': 'text/json'
});
var obj = {
mode: 'no-cors',
method: 'GET',
headers: headers
};
fetch(url, obj)
.then((resp) => resp.json())
.then(data => console.log(data))
.then(function(res) {
return res.json();
})
.then(function(res) {
console.log(res);
})
.catch(function(err) {
console.log(err);
});