/AWS1/IF_PPM=>GETWHATSAPPMESSAGEMEDIA()¶
About GetWhatsAppMessageMedia¶
Get a media file from the WhatsApp service. On successful completion the media file is
retrieved from Meta and stored in the specified Amazon S3 bucket. Use either
destinationS3File or destinationS3PresignedUrl for the
destination. If both are used then an InvalidParameterException is
returned.
Method Signature¶
METHODS /AWS1/IF_PPM~GETWHATSAPPMESSAGEMEDIA
IMPORTING
!IV_MEDIAID TYPE /AWS1/PPMWHATSAPPMEDIAID OPTIONAL
!IV_ORIGINATIONPHONENUMBERID TYPE /AWS1/PPMWHATSAPPPHONENUMBERID OPTIONAL
!IV_METADATAONLY TYPE /AWS1/PPMBOOLEAN OPTIONAL
!IO_DESTINATIONS3PRESIGNEDURL TYPE REF TO /AWS1/CL_PPMS3PRESIGNEDURL OPTIONAL
!IO_DESTINATIONS3FILE TYPE REF TO /AWS1/CL_PPMS3FILE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ppmgetwhatsappmsgme01
RAISING
/AWS1/CX_PPMACCESSDENIEDEX
/AWS1/CX_PPMVALIDATIONEX
/AWS1/CX_PPMACCDENIEDBYMETAEX
/AWS1/CX_PPMDEPENDENCYEX
/AWS1/CX_PPMINTERNALSERVICEEX
/AWS1/CX_PPMINVALIDPARAMSEX
/AWS1/CX_PPMRESOURCENOTFOUNDEX
/AWS1/CX_PPMTHROTTLEDREQUESTEX
/AWS1/CX_PPMCLIENTEXC
/AWS1/CX_PPMSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_mediaid TYPE /AWS1/PPMWHATSAPPMEDIAID /AWS1/PPMWHATSAPPMEDIAID¶
The unique identifier for the media file.
iv_originationphonenumberid TYPE /AWS1/PPMWHATSAPPPHONENUMBERID /AWS1/PPMWHATSAPPPHONENUMBERID¶
The unique identifier of the originating phone number for the WhatsApp message media. The phone number identifiers are formatted as
phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
Optional arguments:¶
iv_metadataonly TYPE /AWS1/PPMBOOLEAN /AWS1/PPMBOOLEAN¶
Set to
Trueto get only the metadata for the file.
io_destinations3presignedurl TYPE REF TO /AWS1/CL_PPMS3PRESIGNEDURL /AWS1/CL_PPMS3PRESIGNEDURL¶
The presign url of the media file.
io_destinations3file TYPE REF TO /AWS1/CL_PPMS3FILE /AWS1/CL_PPMS3FILE¶
The
bucketNameandkeyof the S3 media file.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ppmgetwhatsappmsgme01 /AWS1/CL_PPMGETWHATSAPPMSGME01¶
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->getwhatsappmessagemedia(
io_destinations3file = new /aws1/cl_ppms3file(
iv_bucketname = |string|
iv_key = |string|
)
io_destinations3presignedurl = new /aws1/cl_ppms3presignedurl(
it_headers = VALUE /aws1/cl_ppmheaders_w=>tt_headers(
(
VALUE /aws1/cl_ppmheaders_w=>ts_headers_maprow(
value = new /aws1/cl_ppmheaders_w( |string| )
key = |string|
)
)
)
iv_url = |string|
)
iv_mediaid = |string|
iv_metadataonly = ABAP_TRUE
iv_originationphonenumberid = |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_mimetype( ).
lv_long = lo_result->get_filesize( ).
ENDIF.