deleteWhatsAppMessageMedia method
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.
May throw AccessDeniedByMetaException.
May throw DependencyException.
May throw InternalServiceException.
May throw InvalidParametersException.
May throw ResourceNotFoundException.
May throw ThrottledRequestException.
Parameter mediaId :
The unique identifier of the media file to delete. Use the
mediaId returned from PostWhatsAppMessageMedia.
Parameter originationPhoneNumberId :
The 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.
Implementation
Future<DeleteWhatsAppMessageMediaOutput> deleteWhatsAppMessageMedia({
required String mediaId,
required String originationPhoneNumberId,
}) async {
final $query = <String, List<String>>{
'mediaId': [mediaId],
'originationPhoneNumberId': [originationPhoneNumberId],
};
final response = await _protocol.send(
payload: null,
method: 'DELETE',
requestUri: '/v1/whatsapp/media',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return DeleteWhatsAppMessageMediaOutput.fromJson(response);
}