get_document_content
¶
get_document_content(
application_id: ApplicationId,
index_id: IndexId,
document_id: DocumentId,
*,
config_overrides: Optional[QBusinessClientConfig] = None,
data_source_id: Optional[DataSourceId] = None,
output_format: Optional[OutputFormat] = None,
) -> GetDocumentContentResponse
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:
-
application_id(ApplicationId) –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.
-
index_id(IndexId) –The identifier of the index where documents are indexed.
-
data_source_id(Optional[DataSourceId], default: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(DocumentId) –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.
-
output_format(Optional[OutputFormat], default:None) –Document outputFormat. Defaults to RAW if not selected.
Raises:
-
AccessDeniedException–You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.
-
InternalServerException–An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.
-
ResourceNotFoundException–The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.
-
ThrottlingException–The request was denied due to throttling. Reduce the number of requests and try again.
-
ValidationException–The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_qbusiness/_services/q_business.py
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 | |