Creating an Application: Restricted IPs and JavaScript Domains?

I am very new to using this API and was wondering if it was necessary to fill in these two categories when initially creating and application. I am a complete noobie and am not sure entirely what they are for and if it might be the reason my program is failing to authenticate. An explanation of their function would be very much appreciated!

Unless you’re only using the “test” / “sandbox” - which I have no knowledge of, the answer is yes, you’ll need to list at least one of the things below:

  • The domains your (javascript) code is running from if you’re calling Companies House from client-side javascript.

  • Your server’s external IP if calling from a server (e.g. not via client-side javascript) - except…

  • … if you’re running a local host server, in which case there’s a “hack” to get round this - answers on how to do that can be found by searching this forum.

You almost certainly want to be using the live system. I’ve not tried the test side but posts seem to indicate this is problematic or limited.

Here’s a very quick overview:

Hope that helps. I was (mildly…) surprised to find that this does indeed seem lacking from the current Companies House documentation.
Good luck.

1 Like

Thank you very much for the response, I will give it another shot!

Fixed, Thank you! I was attempting to use a “test” API key in a non-test environment. I misunderstood the reason for having test and non test API keys, if anyone else has this issue that is likely why.

1 Like