Fetch a document API

Welcome to the forum!

If you’re trying to use the “Explore this API” form on the Document Download page I don’t think this works - see e.g.
http://forum.aws.chdev.org/t/not-able-to-download-companies-account-data-using-api/569

Otherwise, you should be able to find the answers in @MArkWilliams post above yours - as he says the place to start is the CH API documentation.

For detail on the general process for downloading a document you might find my response here helpful:
http://forum.aws.chdev.org/t/document-problems-with-cors/1627/2

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

  1. 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” }.
  2. For a given document request the document metadata via CH Document API. Parse the response to get the document (mime) types available and the link to the actual document data (document URI fragment).
  3. Request the actual document, specifying the mime type (e.g. “application/pdf”).
  4. CH send back a response which is a redirect (http 302) to the document. The documents are stored on Amazon servers ATM.
  5. Request this URI from Amazon again passing the content type you want again.
  6. 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.

Hope this helps. If not please state clearly the problem you’re trying to solve and if you have errors or think there’s a bug provide a minimal test case and / or examples of the data which is not correct.