I have created a temporary application to get a streaming key, to access
Streaming API: Basic company information stream (company-information.service.gov.uk)
following the instructions for Streaming given at
I have used XHR in Excel and with JavaScript, but I can’t get through.
EXCEL
Sub Button1_Click()
Dim xmlhttp As Object
Set xmlhttp = CreateObject(“MSXML2.serverXMLHTTP”)
Dim myurl As String
myurl = “https://stream.companieshouse.gov.uk/companies”
skey = “f8da6601-6121-49e7-9b1f-8e3d7f726b57”
key64 = “ZjhkYTY2MDEtNjEyMS00OWU3LTliMWYtOGUzZDdmNzI2YjU3Og==”
xmlhttp.Open “GET”, myurl, False
xmlhttp.setRequestHeader “Authorization”, "Basic " & key64
xmlhttp.Send
rsp = xmlhttp.responseText
[a4] = rsp
End Sub
JS
xhr =new XMLHttpRequest();
url = “https://stream.companieshouse.gov.uk/companies”;
skey = “f8da6601-6121-49e7-9b1f-8e3d7f726b57”;
key64 = “ZjhkYTY2MDEtNjEyMS00OWU3LTliMWYtOGUzZDdmNzI2YjU3Og==”;
xhr.open(“GET”,url, false);
xhr.setRequestHeader(“Authorization”, "Basic " + key64);
xhr.onload=()=>{
rsp = xhr.response;
out.innerHTML = rsp;
}
xhr.send();