Welcome. Downloading documents is something that seems to cause people troubles.
I know nothing about “power automate” - presumably Microsoft Power Automate? So I can’t help you with the details of that but it sounds like you’ve at least managed to connect to Companies House.
It’s not clear exactly the URLs / data you were sending. It is sometimes helpful to know this when trying to understand an issue with a web service / REST API. You can always obscure some of the details!
Your problem may be due to the fact that the document metadata (and indeed document data) is on a different host (“document-api.company-information.service.gov.uk” vs. “api.company-information.service.gov.uk”). Also in the past you might see slightly different hosts listed in the returned data. They should still work fine. However I can’t tell what you actually sent so I don’t know.
A quick step through of what I guess you’re doing:
-
Get Filing History List - you make a request to https://api.company-information.service.gov.uk/company/{company_number}/filing-history (substitute the appropriate {company_number}) as described in the Filing History List Docs.
-
At this point you will have a Filing History Resource. This contains a list of
items
with the same data for each as you’d get from calling Filing History Item. (As far as I’m aware this is still the case). So there’s no need to make another call. Just find the item you want in the list ofitems
, get thelinks.document_metadata
and use that.
It should be of the form:
https://document-api.company-information.service.gov.uk/document/{document_id}
(The document_id
part will obviously vary.) You can then just request that per the documentation.
I’ve written a couple of posts on downloading documents with more or less detail. They should still be current:
Good luck.