2

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

Anant
  • 534
  • 11
  • 40
  • 2
    https://developers.facebook.com/docs/apps/changelog#v2_4_changes explicitly mentions this change btw. – CBroe Jul 15 '15 at 09:18

1 Answers1

10

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

See

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
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • Thank you, somehow I missed it in the doc. – Anant Jul 17 '15 at 16:20
  • Thank you! I already thought the API version 2.4 is totally crap :) I think the documentation is not that clear at the moment... – Matthias Kleine Aug 09 '15 at 20:11
  • @Matthias Kleine Actually, I think this isn't even included in the normal docs, it's only in the changelog afaik... – Tobi Aug 10 '15 at 07:21
  • and everything going into url is just not ok. Asking for a larger amount of data gives 'url limit' issue when requested for famous public pages. I don't understand the logic behind this, are they increasing security by this, I think No. – Anant Aug 18 '15 at 10:35
  • What's an "url limit"? – Tobi Aug 18 '15 at 12:32
  • @Tobi ...Here it is `{"error":{"code":-3,"message":"Please reduce the amount of data you're asking for, then retry your request"}}` And this when I reduced requested data to the minimum, in previous API I requested much more data but never faced any issue. ps: This issue comes only for pages not for profile(till now) – Anant Aug 18 '15 at 14:52