diff --git a/WhatsappBusiness.CloudApi/Interfaces/IWhatsAppBusinessClient.cs b/WhatsappBusiness.CloudApi/Interfaces/IWhatsAppBusinessClient.cs index 499131c..a1d3073 100644 --- a/WhatsappBusiness.CloudApi/Interfaces/IWhatsAppBusinessClient.cs +++ b/WhatsappBusiness.CloudApi/Interfaces/IWhatsAppBusinessClient.cs @@ -604,7 +604,15 @@ public interface IWhatsAppBusinessClient /// /// Send Video Message by Template /// - /// VideoTemplateMessageRequest object + /// VideoTemplateMessageRequest object + /// Cancellation token + /// WhatsAppResponse + WhatsAppResponse SendVideoAttachmentTemplateMessage(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default); + + /// + /// Send Video Message by Template + /// + /// VideoTemplateMessageRequest object /// Cancellation token /// WhatsAppResponse Task SendVideoAttachmentTemplateMessageAsync(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default); diff --git a/WhatsappBusiness.CloudApi/WhatsAppBusinessClient.cs b/WhatsappBusiness.CloudApi/WhatsAppBusinessClient.cs index 4cb74df..5436b78 100644 --- a/WhatsappBusiness.CloudApi/WhatsAppBusinessClient.cs +++ b/WhatsappBusiness.CloudApi/WhatsAppBusinessClient.cs @@ -981,6 +981,18 @@ public async Task SendVideoAttachmentMessageByIdAsync(VideoMes return await WhatsAppBusinessPostAsync(videoMessage, formattedWhatsAppEndpoint, cancellationToken); } + /// + /// Send Video Template Message + /// + /// + /// + /// + public WhatsAppResponse SendVideoAttachmentTemplateMessage(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default) + { + var formattedWhatsAppEndpoint = WhatsAppBusinessRequestEndpoint.SendMessage.Replace("{{Phone-Number-ID}}", _whatsAppConfig.WhatsAppBusinessPhoneNumberId); + return WhatsAppBusinessPostAsync(videoTemplateMessageRequest, formattedWhatsAppEndpoint, cancellationToken).GetAwaiter().GetResult(); + } + /// /// Send Video Template Message /// diff --git a/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj b/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj index b3d8251..9737ed6 100644 --- a/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj +++ b/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj @@ -12,7 +12,7 @@ https://github.com/gabrieldwight/Whatsapp-Business-Cloud-Api-Net enable latest - 1.0.10 + 1.0.11