3

任何人都可以帮助我使用 facebook 的新 Graph Api v2.4 检索数据,以前我使用的是这个 url-

https://graph.facebook.com/ {user-id}/feed?limit=1&locale=en_GB&access_token={access-token}

以前它提供所有数据,(提供json格式的数据视图)

    "id": "12345_67890",
    "from": {
      "name": "xyz",
      "id": "123456"
    },
    "message": "hwregdsfdsf",
    "link": "http://example.com/wordpress/",
    "name": "example.com",
    "caption": "example.com",
    "icon": "https://www.facebook.com/images/icons/post.gif",
    "actions": [
      {
        "name": "Comment",
        "link": "https://www.facebook.com/12345/posts/67890"
      },
      {
        "name": "Like",
        "link": "https://www.facebook.com/12345/posts/67890"
      },
      {
        "name": "Share",
        "link": "https://www.facebook.com/12345/posts/67890"
      }
    ],
    "privacy": {
      "value": "EVERYONE",
      "description": "Public",
      "friends": "",
      "allow": "",
      "deny": ""
    },
    "type": "link",
    "status_type": "shared_story",
    "application": {
      "category": "Business",
      "link": "http://example.com/wordpress/",
      "name": "him_test_app",
      "id": "562********27561"
    },
    "created_time": "2015-07-09T14:17:56+0000",
    "updated_time": "2015-07-09T14:17:56+0000",
    "is_hidden": false,
    "subscribed": true,
    "is_expired": false
  }

但现在它只提供

     "message": "hwregdsfdsf",
     "created_time": "2015-07-09T14:17:56+0000",
     "id": "12345_67890"
  }

好的,已经实现了

它在Webkul的 Joomla 的各种漂亮模块中的实现,看起来很棒,看看这里

4

1 回答 1

10

您可以手动指定要从 Grpah API 返回的字段。

例如

https://graph.facebook.com/{user-id}/feed?limit=1&locale=en_GB&access_token={access-token}&fields=id,from,message,link,caption,icons,actions,privacy,status_type
于 2015-07-15T07:28:36.867 回答