Postman API call

I have registered a test account to see if I can get the API working.
In postman’s Authorization section I am using the “API Key” as the value and “Key Name” as key - but I get the following ( I have Add to Header enabled):

{“error”:“Empty Authorization header”,“type”:“ch:service”}

Set your Authorization type as “Basic Auth” and set your apikey as the username, blank password. Doesn’t make sense but it works.

I am still getting a 401 - “Invalid Authorization” response. See image.
Am I using the correct url to retrieve data on a company (I have inserted a dummy value in url)?

1 Like

Try this instead - https://api.companieshouse.gov.uk

so for example

https://api.companieshouse.gov.uk/company/NF00XXXX

why do you guys give wrong answers?What’s wrong with you.

@sachin.vbsllp i’m sorry do you have the correct answer then? I am only giving this answer because i have a full postman api collection and its working and i am using them in a live project.

Here is a screenshot of KPMG LLP (OC301540)

GET URL : https://api.companieshouse.gov.uk/company/OC301540

I changed
Application environment - test
to
Application environment - live
it works for me now.

5 Likes

@jeremy where did you do this? I have not had to do set this anywhere?

@berto did you get this working evenutally


for ‘test’
I had received
{
“error”: “Invalid Authorization”,
“type”: “ch:service”
}

for ‘live’
response is good

thanks @jeremy it looks like this has been recently updated there was no “manage application” section before where you had you had to choose live or test. just create an api key and use.

@jeremy’s answer is the crucial answer here.

Luckily, I guessed this from an almost entirely unrelated post in another thread before reading this one, but not before I’d spent a fruitless hour going back and forth with my code and eventually performing the example curl call with no success.

Sorry for shouting, but…

To access the live api.company-information.service.co.uk you must have a ‘live’ application.