Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve data from facebook graph API 2.4

Can anyone help me to retrieve data using new Graph Api v2.4 of facebook, previously I was using this url-

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

Previously it provides all the data, (provide data view in json format)

    "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
  }

But now it provide only

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

Ok, it has been implemented

Its implementation in various beautiful modules of Joomla by Webkul, looks great, have a look here

  • Facebook Wall
  • Multi facebook Wall
  • Multi Social Tabs
  • Facebook Event
like image 997
Anant Avatar asked Apr 16 '26 16:04

Anant


1 Answers

You can manually specify the fields you want to be returned from the Grpah API.

See

  • https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#fields

For example

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
like image 103
Tobi Avatar answered Apr 23 '26 22:04

Tobi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!