Skip to main content
Version: 4.0.0

📢 Reply to a message

Send reply to a specific message

await whatsapp.reply(
phoneNumber: 'RECIPIENT_NUMBER',
messageId: 'MESSAGE_ID',
reply: reply().text("Thanks for contacting us", true),
);
paramtyperequireddescription
phoneNumberStringyesPhone number with country code.
messageIdStringyesA message ID
replyMap<String, dynamic>yesReply content

reply

For reply to a specific message, you can use reply class methods, or you can use custom JSON object.

Here is predefined methods for reply:

Text
reply().text(
"Thanks for contacting us", //reply Text
true, //URL preview
);
Image
reply().imageById(
"1100XXXXXXXXXXXXX", //Image Media ID
);
Audio
reply().audioById(
"1100XXXXXXXXXXXXX", //Audio Media ID
);
Video
reply().videoById(
"1100XXXXXXXXXXXXX", //Video Media ID
);
Document
reply().documentById(
"1100XXXXXXXXXXXXX", //Document Media ID
);
Custom Object

You can pass your custom object as well. Find documentation here https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages/#replies

await whatsapp.reply(
phoneNumber: 'RECIPIENT_NUMBER',
messageId: 'MESSAGE_ID',
reply: {
"type":"image",
"image" : {
"link" :"https://example.com/sample.jpg"
}
},
);