Yes, I am. Although it varies based on how I am calling it.
On Java I am getting a 502 (Bad Gateway) error, using the URL https://api.companieshouse.gov.uk/search/companies?q=king&items_per_page=20&start_index=1 (I have searched for “king” on the Try It function on the website and it returns values) authorised using the pair “Authorization”, “Basic “+encodedPassword[from the API Key field on the website after login]+”:”, with values: “Content-Type”, “text/json”, “Content-Length”, “10000000” and the request method GET.
On JMeter I am getting just the empty brackets mentioned before for the JSON response, server name api.companieshouse.gov.uk using https GET, with Authorization, “Basic “+encodedPassword[from the API Key field on the website after login]+”:” and Content-Type, text/json, using the path search/companies?q=king&items_per_page=20&start_index=1
I can’t see anything that varies from the instructions given on the forum or in the documentation, so I am not too sure what the problem would be. I presume there are no problems using this service internationally?
The 502 error implies it’s a server error on our side but I’ve tried the same query a number of times and it worked every time.
Can you try (replacing ENCODED_API_KEY with your encoded API key): curl -v https://api.companieshouse.gov.uk/search/companies\?q\=king\&items_per_page\=20\&start_index\=1 --header "Authorization: Basic <ENCODED_API_KEY>"
The 502 error implies it’s a server error on our side but I’ve tried the same query a number of times and it worked every time.
Can you try (replacing ENCODED_API_KEY with your encoded API key): curl -v https://api.companieshouse.gov.uk/search/companies\?q\=king\&items_per_page\=20\&start_index\=1 --header "Authorization: Basic <ENCODED_API_KEY>"
I still haven’t been able to get this to work on either JMeter or Java code.
But I am a bit confused as to what I am supposed to submit on the Authorization property, is it the API_Key as on the site with a colon appended (as on my curl command) or a base 64 encoding of the key with colon on the end?
The command that you sent results in a “HTTP/1.1 401 Unauthorized” error, both with XXXXXX: and base64Encode(XXXXXX:)