/AWS1/IF_QQB=>GETMEDIA()¶
About GetMedia¶
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.
Method Signature¶
METHODS /AWS1/IF_QQB~GETMEDIA
IMPORTING
!IV_APPLICATIONID TYPE /AWS1/QQBAPPLICATIONID OPTIONAL
!IV_CONVERSATIONID TYPE /AWS1/QQBCONVERSATIONID OPTIONAL
!IV_MESSAGEID TYPE /AWS1/QQBMESSAGEID OPTIONAL
!IV_MEDIAID TYPE /AWS1/QQBMEDIAID OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_qqbgetmediaresponse
RAISING
/AWS1/CX_QQBACCESSDENIEDEX
/AWS1/CX_QQBINTERNALSERVEREX
/AWS1/CX_QQBLICENSENOTFOUNDEX
/AWS1/CX_QQBMEDIATOOLARGEEX
/AWS1/CX_QQBRESOURCENOTFOUNDEX
/AWS1/CX_QQBTHROTTLINGEX
/AWS1/CX_QQBVALIDATIONEX
/AWS1/CX_QQBCLIENTEXC
/AWS1/CX_QQBSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_applicationid TYPE /AWS1/QQBAPPLICATIONID /AWS1/QQBAPPLICATIONID¶
The identifier of the Amazon Q Business which contains the media object.
iv_conversationid TYPE /AWS1/QQBCONVERSATIONID /AWS1/QQBCONVERSATIONID¶
The identifier of the Amazon Q Business conversation.
iv_messageid TYPE /AWS1/QQBMESSAGEID /AWS1/QQBMESSAGEID¶
The identifier of the Amazon Q Business message.
iv_mediaid TYPE /AWS1/QQBMEDIAID /AWS1/QQBMEDIAID¶
The identifier of the media object. You can find this in the
sourceAttributionsreturned by theChat,ChatSync, andListMessagesAPI responses.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_qqbgetmediaresponse /AWS1/CL_QQBGETMEDIARESPONSE¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->getmedia(
iv_applicationid = |string|
iv_conversationid = |string|
iv_mediaid = |string|
iv_messageid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_blob = lo_result->get_mediabytes( ).
lv_string = lo_result->get_mediamimetype( ).
ENDIF.