Search code examples
facebookfacebook-messengerpayloadfacebook-messenger-bot

Facebook Messenger "Get Started" button not sending the user defined payload


I have setup a "get started" button on my page:

curl -X POST -H "Content-Type: application/json" -d '{ 
  "get_started":{
    "payload":"GET_STARTED_PAYLOAD"
  }
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=token"

This works fine and responds with {"result":"success"}

If I check the data:

curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=get_started&access_token=token

I've got a good answer: {"data":[{"get_started":{"payload":"GET_STARTED_PAYLOAD"}}]}

However when I receive the postback webhook, I've got this payload:

{
  "object": "page",
  "entry": [
    {
      "id": "id1",
      "time": 1501688073860,
      "standby": [
        {
          "recipient": {
            "id": "id1"
          },
          "timestamp": 1501688073860,
          "sender": {
            "id": "id2"
          },
          "postback": {
            "title": "Get Started"
          }
        }
      ]
    }
  ]
}

There is now way I can get the payload I defined (GET_STARTED_PAYLOAD) in the webhook.

On this page the doc says

payload parameter that was defined with the button. This is only visible to the app that send the original template message.

This message is kind of confusing. Any ideas ?


Solution

  • Putting this answer here in case anyone needs it.

    The standby prop indicates you're using the handover protocol, and that the app doesn't have thread control. This causes you not to receive the expected postback event, since the receiving app is not the same as the app that sent the postback.