0

If I send Facebook quick reply JSON like the following:

"quick_replies":[
    {"content_type":"text","payload":"RED","title":"Red"},
    {"content_type":"text","payload":"BLUE","title":"Blue"},
    {"content_type":"text","payload":"GREEN","title":"Special"},
]

and the user picks the "Special" reply, I get back

{"recipient_id":5555,"text":"Special"}

I thought the whole point of the payload field was to provide a value other than the title which would be sent back, but it seems like Facebook just sends the title of the selected reply, which begs the question ... what's the point of the payload field?

machineghost
  • 33,529
  • 30
  • 159
  • 234
  • 2
    Check that when you set up your web hook, you ticked messaging_postbacks in the Edit Page Subscription Fields – Keith Coughtrey Oct 13 '16 at 02:51
  • I have every messaging type hook enabled, ie. `message_deliveries, message_echoes, message_reads, messages, messaging_account_linking, messaging_optins, messaging_postbacks`. – machineghost Oct 13 '16 at 20:44

1 Answers1

6

Yes - you are right you should have so a response with the payload. As you can see in here: https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies#callback

The response should be:

{
  "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"
    }
  }
}  

and as @Keith Coughtrey mentioned you should enable messaging_postbacks permission.

Guy Dubrovski
  • 1,542
  • 1
  • 20
  • 25
  • 1
    Huh; it certainly seems like I should be getting the payload back. Perhaps the Facebook Messenger library I'm using is eating it ... thanks. – machineghost Oct 13 '16 at 20:49
  • You got it right. My mistake was assuming that quick reply's postback is the same as CTA's. It is not. – corlaez Dec 07 '16 at 08:12