rmonjo
rmonjo

Reputation: 2745

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 ?

Upvotes: 0

Views: 1017

Answers (1)

amuramoto
amuramoto

Reputation: 2848

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.

Upvotes: 0

Related Questions