Hi,
Calling the company officers API we are getting a 401 CORS error returned. Last week this was working but we are now seeing the following (where 123456 would be a valid company id):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.companieshouse.gov.uk/company/123456/officers?items_per_page=100. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 401.
Here is how we are calling the API:
$.ajax({
url: "https://api.companieshouse.gov.uk/company/" + companyNumber + "/officers?items_per_page=100",
dataType: "json",
async: false,
headers: {
"Authorization": "Basic XXXXXXXXX" ,
"Content-Type": "application/json"
},
success: function (data) {}
});
Calling other APIs are working as expected - for example the companies API:
var encoded = encodeURIComponent(search);
$.ajax({
url: "https://api.companieshouse.gov.uk/search/companies?q=" + encoded + "+&items_per_page=100",
dataType: "json",
async: false,
headers: {
"Authorization": "Basic XXXXXXXXX" ,
"Content-Type": "application/json"
},
success: function (data) {}
});
We have checked the allowed IP/domains which are correct (and haven’t changed) and they are correct. With other API calls going through successfully just the one for company officers not working.
Have there been any changes recently or known issues we should be aware of?
Thank you.