Skip to main content

whats_app_message_medias

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

Overview

Namewhats_app_message_medias
TypeResource
Idaws.socialmessaging.whats_app_message_medias

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
file_sizeinteger (int64)The size of the media file, in KB.
mime_typestringThe MIME type of the media.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_whats_app_message_mediaselectregionGet 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.
delete_whats_app_message_mediadeletemediaId, originationPhoneNumberId, regionDelete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.

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
mediaIdstringThe unique identifier of the media file to delete. Use the mediaId returned from PostWhatsAppMessageMedia.
originationPhoneNumberIdstringThe unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
regionstringAWS region (default: us-east-1)

SELECT examples

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.

SELECT
file_size,
mime_type
FROM aws.socialmessaging.whats_app_message_medias
WHERE region = '{{ region }}' -- required
;

DELETE examples

Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.

DELETE FROM aws.socialmessaging.whats_app_message_medias
WHERE mediaId = '{{ mediaId }}' --required
AND originationPhoneNumberId = '{{ originationPhoneNumberId }}' --required
AND region = '{{ region }}' --required
;