EndUserMessagingSocial / Client / post_whatsapp_message_media
post_whatsapp_message_media#
- EndUserMessagingSocial.Client.post_whatsapp_message_media(**kwargs)#
- Upload a media file to the WhatsApp service. Only the specified - originationPhoneNumberIdhas the permissions to send the media file when using SendWhatsAppMessage. You must use either- sourceS3Fileor- sourceS3PresignedUrlfor the source. If both or neither are specified then an- InvalidParameterExceptionis returned.- See also: AWS API Documentation - Request Syntax- response = client.post_whatsapp_message_media( originationPhoneNumberId='string', sourceS3PresignedUrl={ 'url': 'string', 'headers': { 'string': 'string' } }, sourceS3File={ 'bucketName': 'string', 'key': 'string' } ) - Parameters:
- originationPhoneNumberId (string) – - [REQUIRED] - The ID of the phone number to associate with the WhatsApp media file. The phone number identifiers are formatted as - phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number’s id.
- sourceS3PresignedUrl (dict) – - The source 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) – 
 
 
 
- sourceS3File (dict) – - The source S3 url for the media file. - bucketName (string) – [REQUIRED] - The bucket name. 
- key (string) – [REQUIRED] - The object key of the media file. 
 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'mediaId': 'string' } - Response Structure- (dict) – - mediaId (string) – - The unique identifier of the posted WhatsApp message. 
 
 
 - 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