createWhatsAppMessageTemplate method

Future<CreateWhatsAppMessageTemplateOutput> createWhatsAppMessageTemplate({
  1. required String id,
  2. required Uint8List templateDefinition,
})

Creates a new WhatsApp message template from a custom definition.

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 templateDefinition : The complete template definition as a JSON blob.

Implementation

Future<CreateWhatsAppMessageTemplateOutput> createWhatsAppMessageTemplate({
  required String id,
  required Uint8List templateDefinition,
}) async {
  final $payload = <String, dynamic>{
    'id': id,
    'templateDefinition': base64Encode(templateDefinition),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/whatsapp/template/put',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWhatsAppMessageTemplateOutput.fromJson(response);
}