get_document_content¶
Operation¶
get_document_content
async
¶
get_document_content(input: GetDocumentContentInput, plugins: list[Plugin] | None = None) -> GetDocumentContentOutput
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
GetDocumentContentInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
GetDocumentContentOutput
|
An instance of |
Input¶
GetDocumentContentInput
dataclass
¶
Dataclass for GetDocumentContentInput structure.
Attributes¶
application_id
class-attribute
instance-attribute
¶
application_id: str | None = None
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.
data_source_id
class-attribute
instance-attribute
¶
data_source_id: str | None = None
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".
document_id
class-attribute
instance-attribute
¶
document_id: str | None = None
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.
index_id
class-attribute
instance-attribute
¶
index_id: str | None = None
The identifier of the index where documents are indexed.
output_format
class-attribute
instance-attribute
¶
output_format: OutputFormat | None = None
Document outputFormat. Defaults to RAW if not selected.
Output¶
GetDocumentContentOutput
dataclass
¶
Dataclass for GetDocumentContentOutput structure.
Attributes¶
mime_type
instance-attribute
¶
mime_type: str
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.
presigned_url
instance-attribute
¶
presigned_url: str
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.