I have been trying to complete the "Fetch a doc" form found at the bottom of the https://developer.companieshouse.gov.uk/document/docs/document/id/content/fetchDocument.html and I am not getting anywhere!
Specifically I do not know what to enter in the 'Authorization' header field. The documentation states that the "header parameter contains the token_type and the access_token". Can anyone enlighten me as to what a 'token_type' and 'access_token' are as I cannot find any prior reference to th…

Hi there,
I was wondering if anyone has had any luck with the "Fetch a Document" within the Document API (https://developer.companieshouse.gov.uk/document/docs/document/id/content/fetchDocument.html). The documentation is not very helpful:
Authorization This header parameter contains the token_type and the access_token. See example
Does anyone know what the token_type and access_token are?
On the explore API section it asked for "id" (Which I know), "Authorization [sic]" (Which I don't…

if you are still having trouble after reading those, feel free to reply to this post.

I am trying to download the compnay accounts data using the below APIs, but it seems one of the API is not working.
First API used to get the company filing history (to get the document id) curl -si -API_KEY: https://api.companieshouse.gov.uk/company/00005295/filing-history I got the document id from the above curl response.
Using the above document id I a trying to download the account data document which is not happening used GET http:///document/{id}/content in Explore this API part, but …

For detail on the general process for downloading a document you might find my response here helpful:

voracityemail:

I don't have the "answer" sorry - we don't use ajax for access, but are the following any help? [ Updated response - sorry missed the ref. to Chrome - so do the following posts help? ] Check the browser type / version - "In the initial definition of the CORS-standard, redirects after a successful CORS-preflight request were not allowed. IE11 implements this (now outdated) standard." This also seems to affect some versions of other browsers (e.g. Chrome - see https://stackoverflow.com/&hellip;

An overview of the process of requesting a CH document goes something like:

Find the document filing you're interested in (e.g. make a filing history request for the company). Parse the response for the link to the document in the field "links" : { "document_metadata" : "link URI fragment here" }.

CH send back a response which is a redirect (http 302) to the document. The documents are stored on Amazon servers ATM.

Request this URI from Amazon again passing the content type you want again.

Amazon send the actual document data.

Depending on the system you're using parts 4-6 may occur automatically e.g. if using javascript I think you just make the request (step 3) and your code will receive the data (step 6). More details in the post above if needed.

Hi there, thank for your clarification. I've been following the above steps (in R) with partial success, but still fail to get access to documents' content:

Find the document filing you're interested in (e.g. make a filing history request1 for the company). Parse the response for the link to the document in the field "links" : { "document_metadata" : "link URI fragment here" }.

2 For a given document request the document metadata via CH Document API3. Parse the response to get the document (mime) types available and the link to the actual document data (document URI fragment).