/AWS1/IF_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.
The IAM permissions are derived from the qapps:ImportDocument action. For more information on the IAM policy for Amazon Q Apps, see IAM permissions for using Amazon Q Apps.
Method Signature¶
METHODS /AWS1/IF_QQA~CREATEPRESIGNEDURL
IMPORTING
!IV_INSTANCEID TYPE /AWS1/QQAINSTANCEID OPTIONAL
!IV_CARDID TYPE /AWS1/QQAUUID OPTIONAL
!IV_APPID TYPE /AWS1/QQAUUID OPTIONAL
!IV_FILECONTENTSSHA256 TYPE /AWS1/QQASTRING OPTIONAL
!IV_FILENAME TYPE /AWS1/QQAFILENAME OPTIONAL
!IV_SCOPE TYPE /AWS1/QQADOCUMENTSCOPE OPTIONAL
!IV_SESSIONID TYPE /AWS1/QQAUUID OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_qqacreatepresigurlout
RAISING
/AWS1/CX_QQAACCESSDENIEDEX
/AWS1/CX_QQAINTERNALSERVEREX
/AWS1/CX_QQATHROTTLINGEX
/AWS1/CX_QQAUNAUTHORIZEDEX
/AWS1/CX_QQAVALIDATIONEX
/AWS1/CX_QQACLIENTEXC
/AWS1/CX_QQASERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
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->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->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->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|
).