Summary - check you’re accessing it from a whitelisted IP first e.g. with curl.
Works OK for me. Caveats - I don’t use this wrapper and I’ve not re-registered in the last couple of days. I checked on both the main and the documents API and both return this header.
Quick test with curl:
curl -uMY_API_KEY_HERE: -I "https://api.companieshouse.gov.uk/company/NF004299"
HTTP/1.1 200 OK
Date: Thu, 28 Feb 2019 22:33:16 GMT
(... others snipped, then: )
Access-Control-Allow-Headers: X-RateLimit-Query, origin, content-type, content-length, user-agent, host, accept, authorization
Access-Control-Expose-Headers: X-RateLimit-Window, X-RateLimit-Limit, X-RateLimit-Remain, X-RateLimit-Reset, Location, www-authenticate, cache-control, pragma, content-type, expires, last-modified
X-Ratelimit-Limit: 600
X-Ratelimit-Remain: 599
X-Ratelimit-Reset: 1551393496
X-Ratelimit-Window: 5m
Server: CompaniesHouse
If your query returned an error (e.g. the 403 of late) then these headers aren’t sent:
HTTP/1.1 403 Forbidden
Date: Thu, 28 Feb 2019 22:31:09 GMT
Connection: keep-alive
Server: CompaniesHouse
Or a normal “not found”:
HTTP/1.1 404 Not Found
Content-Length: 19
Content-Type: text/plain; charset=utf-8
Date: Thu, 28 Feb 2019 22:37:47 GMT
Server: nginx/1.12.1
Connection: keep-alive
…so then the wrapper won’t get the headers it was expecting and you’ll see this error.
So even though you said you’d re-registered it might be worth a check, especially that where you’re issuing the request from is in the CH whitelist. I used to be able to access the API from a range of locations which no longer work after the change:
http://forum.aws.chdev.org/t/403-forbidden-when-accessing-the-api/2228