Document Download
This scenario demonstrates how to download a document from Circularo. It shows the process of retrieving a document’s details and then downloading its content. Key features:- Retrieve document details including file hash
- Download document content using the file hash
- Simple and straightforward process for accessing document files
Prerequisites
Before downloading a document, you need:- A valid authentication token (see the “Authentication & Security” section for details)
- The document ID of the document you want to download
This scenario assumes you already know the document ID. For information on how to search for documents, see the document search scenarios.
Step 1 - Retrieve document details
Before downloading a document, you need to retrieve its details to get the file hash. This step fetches the document information using the document ID.- The document ID uniquely identifies the document in the system
- The response includes metadata about the document and its content
- The file hash is needed for the actual download in the next step
- fileHash - Located at
results[0].pdfFile.contentin the response.- The unique file hash (ID) that identifies the document’s content. This hash is used to download the document file.
- Example value:
5nwr01EGjyb9mU6X2lPJzIITKJvAzmWG17R8I7IbIVonAg6NooauXnjY29kOxaOb
- The pdfFile.content field contains the file hash needed for downloading the document
- The response also includes document version information, which is important for operations that modify the document
- Document metadata such as title, type, and creation date are included in the response
Store the file hash for use in the next step. This hash is required to download the document content.
Step 2 - Download document file
This endpoint downloads the document file using the file hash obtained in the previous step.- The file hash uniquely identifies the document’s content in the storage system
- The response is the actual document file (typically a PDF)
- This endpoint can be used to download any file stored in the system, not just document main files
- The file is typically returned as a PDF, but could be in other formats depending on the document type
- The response includes appropriate Content-Type and Content-Disposition headers
- You can save this content to a file or display it in a viewer
Document Download Summary
You have successfully downloaded a document from the Circularo system.Key Concepts
- Document ID: Uniquely identifies a document in the system
- File Hash: Uniquely identifies a file’s content in the storage system
- Two-Step Process: First retrieve document details, then download the file
Next Steps
With the document downloaded, you can now:- Display the document in a viewer
- Save the document to your local system
- Process the document content for further operations
Example Implementation
See our OpenAPI documentation to learn about the full set of API endpoints and parameters.
Please use proper exception handling and function decomposition in your own code. The code is provided for illustrative purposes only and is not intended for production use.