fbsamples/messenger-platform-samples

How to define button payload for generic/text/buttons replies??

chatbot66 opened this issue · 1 comments

function sendQuickReply(recipientId) {
  var messageData = {
    recipient: {
      id: recipientId
    },
    message: {
      text: "What's your favorite movie genre?",
      quick_replies: [
        {
          "content_type":"text",
          "title":"Action",
          "payload":"DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_ACTION"
        },
        {
          "content_type":"text",
          "title":"Comedy",
          "payload":"DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_COMEDY"
        },
        {
          "content_type":"text",
          "title":"Drama",
          "payload":"DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_DRAMA"
        }
      ]
    }
  };

  callSendAPI(messageData);
}

You would use a postback button. Please use issues to report bugs in the repo. For questions about the Platform and help, ask in our FB Messenger Platform developer group where many people can help you.

https://developers.facebook.com/docs/messenger-platform/send-messages/buttons#postback