EndUserMessagingSocial / Client / get_whatsapp_message_media
get_whatsapp_message_media#
- EndUserMessagingSocial.Client.get_whatsapp_message_media(**kwargs)#
- 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 - destinationS3Fileor- destinationS3PresignedUrlfor the destination. If both are used then an- InvalidParameterExceptionis returned.- See also: AWS API Documentation - Request Syntax- response = client.get_whatsapp_message_media( mediaId='string', originationPhoneNumberId='string', metadataOnly=True|False, destinationS3PresignedUrl={ 'url': 'string', 'headers': { 'string': 'string' } }, destinationS3File={ 'bucketName': 'string', 'key': 'string' } ) - Parameters:
- mediaId (string) – - [REQUIRED] - The unique identifier for the media file. 
- originationPhoneNumberId (string) – - [REQUIRED] - 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.
- metadataOnly (boolean) – Set to - Trueto get only the metadata for the file.
- destinationS3PresignedUrl (dict) – - The presign url of the media file. - url (string) – [REQUIRED] - The presign url to the object. 
- headers (dict) – [REQUIRED] - A map of headers and their values. You must specify the - Content-Typeheader when using- PostWhatsAppMessageMedia. For a list of common headers, see Common Request Headers in the Amazon S3 API Reference- (string) – - (string) – 
 
 
 
- destinationS3File (dict) – - The - bucketNameand- keyof the S3 media file.- bucketName (string) – [REQUIRED] - The bucket name. 
- key (string) – [REQUIRED] - The object key of the media file. 
 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'mimeType': 'string', 'fileSize': 123 } - Response Structure- (dict) – - mimeType (string) – - The MIME type of the media. 
- fileSize (integer) – - The file size of the media, in KB. 
 
 
 - Exceptions- EndUserMessagingSocial.Client.exceptions.ValidationException
- EndUserMessagingSocial.Client.exceptions.AccessDeniedException
- EndUserMessagingSocial.Client.exceptions.ResourceNotFoundException
- EndUserMessagingSocial.Client.exceptions.InvalidParametersException
- EndUserMessagingSocial.Client.exceptions.ThrottledRequestException
- EndUserMessagingSocial.Client.exceptions.AccessDeniedByMetaException
- EndUserMessagingSocial.Client.exceptions.InternalServiceException
- EndUserMessagingSocial.Client.exceptions.DependencyException