/AWS1/CL_QQA=>CREATEPRESIGNEDURL()
¶
About CreatePresignedUrl¶
Creates a presigned URL for an S3 POST operation to upload a file. You can use this URL to
set a default file for a FileUploadCard
in a Q App definition or to provide a
file for a single Q App run. The scope
parameter determines how the file will be
used, either at the app definition level or the app session level.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_instanceid
TYPE /AWS1/QQAINSTANCEID
/AWS1/QQAINSTANCEID
¶
The unique identifier of the Amazon Q Business application environment instance.
iv_cardid
TYPE /AWS1/QQAUUID
/AWS1/QQAUUID
¶
The unique identifier of the card the file is associated with.
iv_appid
TYPE /AWS1/QQAUUID
/AWS1/QQAUUID
¶
The unique identifier of the Q App the file is associated with.
iv_filecontentssha256
TYPE /AWS1/QQASTRING
/AWS1/QQASTRING
¶
The Base64-encoded SHA-256 digest of the contents of the file to be uploaded.
iv_filename
TYPE /AWS1/QQAFILENAME
/AWS1/QQAFILENAME
¶
The name of the file to be uploaded.
iv_scope
TYPE /AWS1/QQADOCUMENTSCOPE
/AWS1/QQADOCUMENTSCOPE
¶
Whether the file is associated with a Q App definition or a specific Q App session.
Optional arguments:¶
iv_sessionid
TYPE /AWS1/QQAUUID
/AWS1/QQAUUID
¶
The unique identifier of the Q App session the file is associated with, if applicable.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_qqacreatepresigurlout
/AWS1/CL_QQACREATEPRESIGURLOUT
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
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->/aws1/if_qqa~createpresignedurl(
iv_appid = |string|
iv_cardid = |string|
iv_filecontentssha256 = |string|
iv_filename = |string|
iv_instanceid = |string|
iv_scope = |string|
iv_sessionid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_string = lo_result->get_fileid( ).
lv_string = lo_result->get_presignedurl( ).
LOOP AT lo_result->get_presignedurlfields( ) into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_string = lo_value->get_value( ).
ENDIF.
ENDLOOP.
lv_qappstimestamp = lo_result->get_presignedurlexpiration( ).
ENDIF.
Upload a file to a specific session¶
Upload a file to a specific session
DATA(lo_result) = lo_client->/aws1/if_qqa~createpresignedurl(
iv_appid = |4263767c-d889-4cb2-a8f6-8b649bc66af0|
iv_cardid = |82f69028-22a9-4bea-8727-0eabf58e9fed|
iv_filecontentssha256 = |wXY7GD8m4fmHhdtuQyBdXzNQpdCseVwBcOBIlzfm+kg=|
iv_filename = |myFile.txt|
iv_instanceid = |0b95c9c4-89cc-4aa8-9aae-aa91cbec699f|
iv_scope = |SESSION|
iv_sessionid = |4f0e5b87-9d38-41cd-9eb4-ebce2f2917cc|
).
Upload a file into a application¶
Upload a file into a application
DATA(lo_result) = lo_client->/aws1/if_qqa~createpresignedurl(
iv_appid = |4263767c-d889-4cb2-a8f6-8b649bc66af0|
iv_cardid = |7a11f34b-42d4-4bc8-b668-ae4a788dae1e|
iv_filecontentssha256 = |wXY7GD8m4fmHhdtuQyBdXzNQpdCseVwBcOBIlzfm+kg=|
iv_filename = |anApplicationFile.txt|
iv_instanceid = |0b95c9c4-89cc-4aa8-9aae-aa91cbec699f|
iv_scope = |APPLICATION|
).