Skip to main content

medias

Creates, updates, deletes, gets or lists a medias resource.

Overview

Namemedias
TypeResource
Idaws.qbusiness.medias

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
media_bytesstring (byte)The base64-encoded bytes of the media object.
media_mime_typestringThe MIME type of the media object (image/png).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_mediaselectapplication_id, conversation_id, message_id, media_id, regionReturns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses. For more information, see Extracting semantic meaning from images and visuals.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application_idstringThe identifier of the Amazon Q Business which contains the media object.
conversation_idstringThe identifier of the Amazon Q Business conversation.
media_idstringThe identifier of the media object. You can find this in the sourceAttributions returned by the Chat, ChatSync, and ListMessages API responses.
message_idstringThe identifier of the Amazon Q Business message.
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses. For more information, see Extracting semantic meaning from images and visuals.

SELECT
media_bytes,
media_mime_type
FROM aws.qbusiness.medias
WHERE application_id = '{{ application_id }}' -- required
AND conversation_id = '{{ conversation_id }}' -- required
AND message_id = '{{ message_id }}' -- required
AND media_id = '{{ media_id }}' -- required
AND region = '{{ region }}' -- required
;