Search code examples
facebookfacebook-graph-apireal-time

facebook real-time page api response analysis


i'm getting callbacks from facebook and response like this ;

{
  "object": "page",
  "entry": [
    {
      "id": "2407411660blabla",
      "time": 1450266812,
      "changes": [
        {
          "field": "feed",
          "value": {
            "item": "comment",
            "verb": "add",
            "comment_id": "787904161316072_blabla",
            "post_id": "240741166032377_blabla",
            "parent_id": "240741166032377_blabla",
            "sender_id": 1020447568blabla,
            "created_time": 1450266812,
            "message": "blalba lba lba bla",
            "sender_name": "Mehmet Tubay Saban"
          }
        }
      ]
    }

As you can see , there are two array in this json;

1- entry[]
2- changes[]

Sometimes "entry array" has 1 or more items and some times "changes array" has 1 or more items , what is different between entry and changes array of objects ?


Solution

  • It seems to be based on the "time" value. If several actions has the same "time" value they will appear in the changes[] array.