Creates an Interactive Reply Buttons object for the API
The action for the interactive message
The body for the interactive message
Optional
header: HeaderThe header for the interactive message, it may be undefined if not needed
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
Creates an Interactive List object for the API
The action for the interactive message
The body for the interactive message
Optional
header: HeaderThe header of type text for the interactive message, it may be undefined if not needed
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
import { Interactive, ActionList, Row, Body } from "whatsapp-api-js/messages";
const interactive_list_message = new Interactive(
new ActionList(
"Button text",
new ListSection(
"Section title",
new Row("reply_1", "Hello", "Hello description"),
new Row("reply_2", "World", "World description")
)
),
new Body("Hello World")
);
Creates an Interactive Catalog object for the API
The action for the interactive message
The body for the interactive message
Optional
header: undefinedUndefined
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
Creates an Interactive Single Product object for the API
The action for the interactive message
Optional
body: BodyThe body for the interactive message
Optional
header: undefinedUndefined
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
Creates an Interactive Multi Product object for the API
The action for the interactive message
The body for the interactive message
The header of type text for the interactive message
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
import {
Interactive,
ActionProductList,
ProductSection,
Product
} from "whatsapp-api-js/messages";
const interactive_multi_product_message = new Interactive(
new ActionProductList(
"catalog_id",
new ProductSection(
"Product section title",
new Product("product_id"),
new Product("product_id")
)
),
new Body("Hello World"),
new Header("Hello World Header")
);
Creates an Interactive CTA object for the API
The action for the interactive message
The body for the interactive message
Optional
header: HeaderThe header of type text for the interactive message, it may be undefined if not needed
Optional
footer: FooterThe footer for the interactive message, it may be undefined if not needed
Creates an Interactive Flow object for the API
Optional
header: HeaderOptional
footer: Footerimport {
Interactive,
ActionFlow,
Body
} from "whatsapp-api-js/messages";
const interactive_navigate_flow_message = new Interactive(
new ActionFlow({
flow_token: "5f9b3b4f-2b7a-4f4f-8f4f-4f4f4f4f4f4f",
flow_name: "my_welcome_flow", // Can also use flow_id instead
flow_cta: "Start the Flow!",
mode: "published",
flow_action: "navigate", // Default
flow_action_payload: {
screen: "FIRST_SCREEN",
data: { name: "John" }
}
}),
new Body("How was your experience today?")
);
import {
Interactive,
ActionFlow,
Body
} from "whatsapp-api-js/messages";
const interactive_data_exchange_flow_message = new Interactive(
new ActionFlow({
flow_token: "5f9b3b4f-2b7a-4f4f-8f4f-4f4f4f4f4f4f",
flow_name: "my_welcome_flow", // Can also use flow_id instead
flow_cta: "Start the Flow!",
mode: "published",
flow_action: "data_exchange",
}),
new Body("Hello World") ```
);
@param action - The action for the interactive message @param body - The body for the interactive message @param header - The header of type text for the interactive message, it may be undefined if not needed @param footer - The footer for the interactive message, it may be undefined if not needed @throws If a header is provided and it's not of type "text"
Creates an Interactive Location request object for the API
The action for the interactive message
The body of the interactive message
Readonly
actionThe action for the interactive message
Optional
Readonly
bodyThe body for the interactive message
Optional
Readonly
footerThe footer for the interactive message
Optional
Readonly
headerThe header for the interactive message
Readonly
typeThe type of the interactive message
Interactive API object