createWhatsAppMessageTemplateFromLibrary method

Future<CreateWhatsAppMessageTemplateFromLibraryOutput> createWhatsAppMessageTemplateFromLibrary({
  1. required String id,
  2. required MetaLibraryTemplate metaLibraryTemplate,
})

Creates a new WhatsApp message template using a template from Meta's template library.

May throw AccessDeniedByMetaException. May throw DependencyException. May throw InternalServiceException. May throw InvalidParametersException. May throw ResourceNotFoundException. May throw ThrottledRequestException.

Parameter id : The ID of the WhatsApp Business Account to associate with this template.

Parameter metaLibraryTemplate : The template configuration from Meta's library, including customizations for buttons and body text.

Implementation

Future<CreateWhatsAppMessageTemplateFromLibraryOutput>
    createWhatsAppMessageTemplateFromLibrary({
  required String id,
  required MetaLibraryTemplate metaLibraryTemplate,
}) async {
  final $payload = <String, dynamic>{
    'id': id,
    'metaLibraryTemplate': metaLibraryTemplate,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/whatsapp/template/create',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWhatsAppMessageTemplateFromLibraryOutput.fromJson(response);
}