Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougnukem/00241680c21887f13b1d08b693364e4f to your computer and use it in GitHub Desktop.
Save dougnukem/00241680c21887f13b1d08b693364e4f to your computer and use it in GitHub Desktop.
Facebook Messenger Webhook Payload inconsistency

Facebook Messenger Webhook Payload inconsistency

  • Facebook Messenger Webhook Docs: describes the Entry[] payload as having an ID field that is a Number, but it appears that occasionally it'll be sent as a quoted string?
    • I'd expect ID to be consistent one way or the other.
 {
     "object": "page",
     "entry": [{
         "id": "126782477734654",
         "time": 1463539399013,
         "messaging": [{
             "sender": {
                 "id": "10100897698891436"
             },
             "recipient": {
                 "id": "126782477734654"
             },
             "timestamp": 1463539398969,
             "message": {
                 "mid": "mid.1463539398958:9970522824c5134660",
                 "seq": 2034,
                 "text": "yo"
             }
         }]
     }]
 }
{
    "object": "page",
    "entry": [{
        "id": 126782477734654,
        "time": 1463539268154,
        "messaging": [{
            "sender": {
                "id": "10100897698891436"
            },
            "recipient": {
                "id": "126782477734654"
            },
            "timestamp": 1463539268154,
            "postback": {
                "payload": "y"
            }
        }]
    }]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment