Skip to content

Instantly share code, notes, and snippets.

@LinZap
Last active December 5, 2017 10:21
Show Gist options
  • Save LinZap/77e11b0c9b82211d110df05a14029442 to your computer and use it in GitHub Desktop.
Save LinZap/77e11b0c9b82211d110df05a14029442 to your computer and use it in GitHub Desktop.
messenger data format

Facebook Messenger Data Format

Text Message

{
  "entry": [
    {
      "id": "1944407515840583",
      "time": 1512469177548,
      "messaging": [
        {
          "sender": {
            "id": "1477720125648333"
          },
          "recipient": {
            "id": "1944407515840583"
          },
          "timestamp": 1512469177175,
          "message": {
            "mid": "mid.$cAAaynrt0qeRmV3VrV1gJi_BcAy9G",
            "seq": 579446,
            "text": "QQQQ"
          }
        }
      ]
    }
  ],
  "object": "page"
}

Quick Reply

{
  "object": "page",
  "entry": [
    {
      "id": "201555416547630",
      "time": 1512445087407,
      "messaging": [
        {
          "sender": {
            "id": "941578675940336"
          },
          "recipient": {
            "id": "201555416547630"
          },
          "timestamp": 1512445087063,
          "message": {
            "quick_reply": {
              "payload": "RUSE_COMFRIM_YES"
            },
            "mid": "mid.$cAADto1sy6I1mVgXVV1gJMArMUtdT",
            "seq": 579360,
            "text": ""
          }
        }
      ]
    }
  ]
}

Attaching Image

{
  "object": "page",
  "entry": [
    {
      "id": "201555416547630",
      "time": 1512445567523,
      "messaging": [
        {
          "sender": {
            "id": "941578675940336"
          },
          "recipient": {
            "id": "201555416547630"
          },
          "timestamp": 1512445567190,
          "message": {
            "mid": "mid.$cAADto1sy6I1mVg0o1lgJMdyReGkb",
            "seq": 579364,
            "attachments": [
              {
                "type": "image",
                "payload": {
                  "url": "https://scontent-iad3-1.xx.fbcdn.net/v/t34.0-12/24581287_1959058394110698_1709361286_n.png?_nc_ad=z-m&_nc_cid=0&oh=07beaaa1b1bb62624aea0ea1ad77aa3e&oe=5A29254E"
                }
              },
              {
                "type": "image",
                "payload": {
                  "url": "https://scontent-iad3-1.xx.fbcdn.net/v/t35.0-12/24726157_1959058400777364_1908126955_o.png?_nc_ad=z-m&_nc_cid=0&oh=daac69b533518f83e28701e2b6dab79c&oe=5A281C27"
                }
              }
            ]
          }
        }
      ]
    }
  ]
}

Attching URL

{
  "object": "page",
  "entry": [
    {
      "id": "201555416547630",
      "time": 1512445667452,
      "messaging": [
        {
          "sender": {
            "id": "941578675940336"
          },
          "recipient": {
            "id": "201555416547630"
          },
          "timestamp": 1512445667111,
          "message": {
            "mid": "mid.$cAADto1sy6I1mVg6vJ1gJMkBhEYw7",
            "seq": 579369,
            "text": "URLLLLLLL\nhttp://www.cna.com.tw/news/firstnews/201712045001-1.aspx",
            "attachments": [
              {
                "title": "12月4日台灣各報頭條速報 | 重點新聞 | 中央社即時新聞 CNA NEWS",
                "url": "https://l.facebook.com/l.php?u=http%3A%2F%2Fwww.cna.com.tw%2Fnews%2Ffirstnews%2F201712045001-1.aspx&h=ATOjPQ3SW0Z3qg2HyGieywtm-EXDR04woYzbUsdi3mUVMB6dyT2p2aZ6AnyV3bfh_nTWAGnOuaaGPopViR0iTzIrtYM5U3QBZgeeVRygSiAjopu2Nw&s=1&enc=AZOa9Kod27Vam_We6J3OseEswBSuipXU1d3IZxPzRMO5UvnUX93vSiVyAvgzeSTRcTodSa0WMnkDgcmIozFjxW7y",
                "type": "fallback",
                "payload": null
              }
            ]
          }
        }
      ]
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment