whatsapp-api-js - v6.1.0
    Preparing search index...

    Class BodyParameter

    Parameter API object

    Hierarchy (View Summary)

    Index

    Constructors

    • Builds a parameter object for a BodyComponent. For text parameter, the character limit is 32768 if only one BodyComponent is used for the Template, else it's 1024. Both Header and Body components must use the same type of variables, either named or numbered.

      Parameters

      • parameter: string | Currency | DateTime

        The parameter to be used in the template

      • Optionalparameter_name: string

        Name of the parameter, optional if using numbered variables

      Returns BodyParameter

      If parameter is a string and it's over 32768 characters

      If parameter is a string, there are other components in the Template and it's over 1024 characters

      If parameter_name is over 20 characters long or contains invalid characters (only lowercase a-z and _ are allowed)

      BodyComponent._build The method that checks the 1024 character limit

    Properties

    currency?: Currency

    The currency of the parameter

    date_time?: DateTime

    The datetime of the parameter

    parameter_name?: string

    The name of the parameter, optional if using number variables

    text?: string

    The text of the parameter

    type: "text" | "currency" | "date_time"

    The type of the parameter