Skip to content Skip to sidebar Skip to footer

Messenger Quick Response Does Not Trigger Postbak

I am learning how to make messenger bots. I have code to listen for 'what is the meaning of life' and then give 2 quick response's '42' and 'chocolate' the payload for 42 is 'the r

Solution 1:

When a quick reply button is tapped, it will not trigger a postback. Instead a callback will be received with a different response format than that of postback. The event will have a message attribute which will be similar to your quick reply button type with a quick_reply key which contains the payload of the button.

{
  "sender": {
    "id": "USER_ID"
  },
  "recipient": {
    "id": "PAGE_ID"
  },
  "timestamp": 1464990849275,
  "message": {
    "mid": "mid.1464990849238:b9a22a2bcb1de31773",
    "seq": 69,
    "text": "Red",
    "quick_reply": {
      "payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED"
    }
  }
}   

So, you can access the quick reply payload using

event.message.quick_reply.payload

Post a Comment for "Messenger Quick Response Does Not Trigger Postbak"