Companies House service HTTP response code is Forbidden (403)

Our key return API error 403

2019-02-28 08:55:28,785 [DEBUG] tid:13 uID: cID: lID: Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies constructor found, invoking…
2019-02-28 08:55:28,785 [DEBUG] tid:13 uID: cID: lID: Strategy_Start
2019-02-28 08:55:28,785 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 Start_Invoke [Execute] handler [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,785 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 An object (i.e. connection) pool-151411(151411) is taken from the pool for the 7th time, state Open. [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,787 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 Query completed in 1ms on connection pool-151411. Request: LoadBackdoorCompaniesHouseData(@CustomerID = 30528) [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,787 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 Companies House backdoor data was not loaded for customer 30528: backdoors are disabled. [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,855 [ERROR] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 Companies House service HTTP response code is Forbidden (403). [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,855 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 End_Invoke [Execute] handler [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:28,855 [DEBUG] Ezbob Production EzService EZ-PROD-SRV01 tid:13 SearchCompaniesHouseCompanies uID:30528 cID:30528 lID:0 Strategy_End [30528,“ezb”] Ezbob.Backend.Strategies.CompaniesHouse.SearchCompaniesHouseCompanies
2019-02-28 08:55:31,548 [INFO] tid:13 uID: cID: lID: prod instance created.

…indeed - but that is not so helpful to those who don’t have your code…

This may be to do with recent changes made by CH:

  • IP address security has changed - “If you are getting 403’s you will have to either update your API account Restricted IPs to ensure you have the correct IP addresses or remove them altogether.”
  • Yesterday afternoon CH deployed some code which caused issues and then backed it out again. See this post and this one.

…so after reading those if you still have issues you probably need to post back here giving your IP address / domain name. Maybe also post the endpoint you were calling and any http headers you were sending (but not your real API key!).

I think if you exceed the rate limit the documents state you’ll get a 429 Too Many Requests but on this post it suggests you may get a 403. The current limits are 600 calls in a 5 minute window, and there are separate rates for the main API and the documents API if I recall correctly.