I have set the authorisation to “basic” and I have added my key. It’s asking for a username too, but I don’t seem to have one. Does anyone know what I should put in here? I have tried putting the key in both and also putting “API Key” in the user name. I can see the header is basic and I believe Postman automatically base64 encodes the header.
The way CH do this: the http “username” is their “API key” and there is no password. I think that should be fine with Postman but there are some tools which seem to prevent “blanks”.
If you want to download the actual filing documents there are a couple of details to that. I’ve an answer here which might help if you need that:
You can normally find what you want with some searching on this forum or reading the documentation. For example on this topic you might also try these threads:
Authorisation seems to be the biggest source of confusion. I guess this data / the API just has such a wide appeal that the numbers using it are large and the demographic is wide.
My API key works on the website, so the API is correct.
Eventually I used https://www.base64decode.org/ to decode the header having followed all of the articles. This lead me to find out that my key was being used twice not once. Then I was able to find out where my username/password were still both set in Postman.
I set the collection to contain the authorisation as basic and only my key in the username followed by a colon.
I made sure password was empty.
I set the variables so I could use the base_url, hence I set the variable name base_url and https://api.companieshouse.gov.uk
Then I set it to get and {{base_url}}/company/06623345/registered-office-address which worked.
If anyone ever gets stuck in the future you can simply import this JSON file to Postman and all of the requests are set up already. All you need to do is right click on “collections” click on “edit” and then click on “authorisation” and “variables” and change them to your own. Don’t forget to add a colon after your key.
Can you please let us know what was the header and authorization details you put?
Please try to put some example… tried what have been mentioned by you but it is not working for me.
help appreciated.
How you downloaded the API I made on Github? It has all of the calls in it properly. All you need to do is to put your key in the main configuration. Just click on the 3 dots and then click edit.
Make sure authorisation is Basic and put your key in as you have shown above. I didn’t put this into the headers I just let the config do it. I think it base64 encodes it automatically. Perhaps that’s the difference.
Eoin, may thanks for taking the time to do this. After spending many hours today trying to get the API working your script is now up and running in postman on my machine… very good of you!!!
I don’t know how many hours I have spent on this API to make it work but still no luck for me. I have followed your postman steps as well. Changed the API_Key followed by ‘:’ . Tried different ways to provide api_key as well including base64. However I am still unlucky.
My deadline for API integration is approaching and I am worrying to implement it in Python. I have a list of company names. All I want is their company number that is provided by this API in the response.
No matter what I try in python or postman… I still get the same error.