401 Unauthorized using curl -> resolved with switch from "test" app to "live" app

Colleagues, I’ve read multiple topics here regarding 401, but found no solution.

  1. API KEY
    Entered after “-u” with “:” at the end, empty password
  2. IP address (externally visible) - entered in Restricted IP list
  3. Just to be sure - added domain gsl.dev for 127.0.0.1 to local hosts file and registered within my app as http://gsl.dev
    Nothing helps - getting 401
    Any info/suggestion is welcome! Thank you

Is your application registered as a live one not test? (Yes… test should work but people have reported various issues).

Some people have also had issues with registering more than one API key and then using the wrong one, worth a double-check.

This exact endpoint (almost) works for us - although one note: it looks like you’re requesting:

https://api.company-information.service.gov.uk/advanced-Search/companies

With a capital “S” there - that will give a 404 error once you’ve sorted out the authorization issue. It should be:

https://api.company-information.service.gov.uk/advanced-search/companies

(Obviously also calling a search endpoint without providing some parameters is in general odd!)

Good luck.

Thx, @voracityemail
Is your application registered as a live one not test? (Yes… test should work but people have reported various issues).
mb: test. After I registered another “live” application - it worked with the “live” key immediately

Some people have also had issues with registering more than one API key and then using the wrong one, worth a double-check.
mb: sure, maybe a problem. I’ve registered 2 keys and checked each one separately multiple times - none of the test “keys” did work

This exact endpoint (almost) works for us - although one note: it looks like you’re requesting:

https://api.company-information.service.gov.uk/advanced-Search/companies

With a capital “S” there - that will give a 404 error once you’ve sorted out the authorization issue. It should be:

https://api.company-information.service.gov.uk/advanced-search/companies

mb: it worked with capital “S”, same way as with “s”, but only with the “live” key

(Obviously also calling a search endpoint without providing some parameters is in general odd!)

mb: yes, but it responded with a reasonable result.

Thx for the hint: the “live” vs “test” was the silver bullet