2025/08/25 - QBusiness - 1 updated api methods
Changes The Amazon Q Business GetDocumentContent operation now supports retrieval of the extracted text content in JSON format.
{'outputFormat': {'EXTRACTED'}}
Retrieves the content of a document that was ingested into Amazon Q Business. This API validates user authorization against document ACLs before returning a pre-signed URL for secure document access. You can download or view source documents referenced in chat responses through the URL.
See also: AWS API Documentation
Request Syntax
client.get_document_content( applicationId='string', indexId='string', dataSourceId='string', documentId='string', outputFormat='RAW'|'EXTRACTED' )
string
[REQUIRED]
The unique identifier of the Amazon Q Business application containing the document. This ensures the request is scoped to the correct application environment and its associated security policies.
string
[REQUIRED]
The identifier of the index where documents are indexed.
string
The identifier of the data source from which the document was ingested. This field is not present if the document is ingested by directly calling the BatchPutDocument API. If the document is from a file-upload data source, the datasource will be "uploaded-docs-file-stat-datasourceid".
string
[REQUIRED]
The unique identifier of the document that is indexed via BatchPutDocument API or file-upload or connector sync. It is also found in chat or chatSync response.
string
Document outputFormat. Defaults to RAW if not selected.
dict
Response Syntax
{ 'presignedUrl': 'string', 'mimeType': 'string' }
Response Structure
(dict) --
presignedUrl (string) --
A pre-signed URL that provides temporary access to download the document content directly from Amazon Q Business. The URL expires after 5 minutes for security purposes. This URL is generated only after successful ACL validation.
mimeType (string) --
The MIME type of the document content. When outputFormat is RAW, this corresponds to the original document's MIME type (e.g., application/pdf, text/plain, application/vnd.openxmlformats-officedocument.wordprocessingml.document). When outputFormat is EXTRACTED, the MIME type is always application/json.