Just use the "context"
in your JSON, followed by the user's message ID
to reply contextually.
curl 'https://graph.facebook.com/v19.0/YOUR_PHONE_NUMBER_ID/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "USER_PHONE_NUMBER",
"context": {
"message_id": "MESSAGE_ID_OF_THE_ORIGINAL_MESSAGE"
},
"type": "text",
"text": {
"body": "YOUR_REPLY_MESSAGE"
}
}'
The MESSAGE_ID_OF_THE_ORIGINAL_MESSAGE
will look something like this: wamid.HGda31LMCY0AKKVNDM4OvAIdaROCUagASBQzQTdCNTg5RjY1MEMyJrlGLRjGUgA
# IMPORTANT
The contextual bubble will not appear at the top of the delivered message if:
The previous message has been deleted or moved to long term storage (messages are typically moved to long term storage after 30 days, unless you have enabled local storage).
You reply with an audio, image, or video message and the WhatsApp user is running KaiOS.
You use the WhatsApp client to reply with a push-to-talk message and the WhatsApp user is running KaiOS.
You reply with a template message.
# DID EVERYTHING CORRECT AND IT'S NOT WORKING?
When I first tried this functionality, I thought it wasn't working, but in reality, it was. I couldn't see the contextual bubble on my computer (Debian 12 - Firefox), but I could see it on my cellphone.
Seeing the reply on my cellphone.
Seeing the same reply, but this time through my computer