new ProductMessage(Creates an instance of ProductInteractionMessage.params
):ProductMessage
string
The body text of the message.
• params.buttonText: string
The button text of the message.
• params.catalogId: string
The catalog ID of the product.
• params.footerText?: string
The footer text of the message.
• params.productRetailerId: string
The product retailer ID of the product.
ProductMessage
InteractiveMessage
.constructor
data: object
catalogId: string
productRetailerId: string
ProductMessageMessageInterface
.data
readonly
interactiveMessageData:object
bodyText: string
optional
footerText:string
optional
header:object
|object
|object
|object
type: InteractiveMessageTypeEnum
ProductMessageMessageInterface
.interactiveMessageData
InteractiveMessage
.interactiveMessageData
messaging_product: "whatsapp"
The messaging product.
ProductMessageMessageInterface
.messaging_product
InteractiveMessage
.messaging_product
recipient_type: "individual"
The recipient type.
ProductMessageMessageInterface
.recipient_type
InteractiveMessage
.recipient_type
type: MessageTypeEnum
The type of the message.
ProductMessageMessageInterface
.type
InteractiveMessage
.type
addFooter(Adds a footer to the message.footerText
):void
string
The footer text to be added.
void
addHeader(): void
Adds a header to the message.
void
Parses the constructor payload using the provided schema.protected
parseConstructorPayload(schema
,payload
):any
ZodType
<any
, ZodTypeDef
, any
>
The Zod schema used for parsing the payload.
• payload: any
The payload to be parsed.
any
The parsed data.
InteractiveMessage
.parseConstructorPayload
toJson(Converts the message to JSON format.params
):object
&object
string
The ID of the message to reply to.
• params.to: string
The recipient of the message.
object
& object
The JSON representation of the message.
InteractiveMessage
.toJson