API connector unable to initialize call

I am trying to call the Companies House API. I have created my API key for a “live” application, and I can successfully call via Postman or Curl.

GET https://api.company-information.service.gov.uk/search/companies?q=CompanyName

When I set up the call in the API connector, the “Initialize call” gives me the following error:

There was an issue setting up your call.

Raw response for the API 
Status code 400
{"error":"Invalid Authorization header","type":"ch:service"}

Upload a screenshot here

Please share the screenshot of your API Connector setup.

I created an application with Companies House using the “live” environment and generated a key. This should be provided as the username for HTTP Basic Auth, the password is ignored.

Bubble will set empty password as “undefined”. This lead to a wrong encoding for the auth header.
Instead, go in https://www.base64encode.org/ , encode your apikey with : at the end (like 124345dsa5dasda:).
In Bubble, change auth for Private key in header
On right in value, Basic encodedbase64key from encoder

1 Like

Wow. That actually worked! Cheers @Jici

1 Like