74

I just tried through the Graph API Explorer with this path /v2.4/10153513872748291 and I've got this result:

{
  "error": {
    "message": "(#12) singular links API is deprecated for versions v2.4 and higher",
    "type": "OAuthException",
    "code": 12
  }
}

But https://developers.facebook.com/docs/reference/api/post/ doesn't say anything about deprecation.

I'm not sure if I miss something, or there's another way to get info about an individual post.

Edit: v2.3 works, but v2.4 is the latest one.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Tanin
  • 1,853
  • 1
  • 15
  • 20

2 Answers2

147

Looks like you now need to the combination of the id of the user or page that made the post (or whose wall it is on), an underscore, and then the post id.

For your example post, 10153513872748291, that is made by a page Drama-addict, that has the id 141108613290 – so 141108613290_10153513872748291 will work.

And so does 788239567865981_10153513872748291, because 788239567865981 is the id of the user making the post.

danronmoon
  • 3,814
  • 5
  • 34
  • 56
CBroe
  • 91,630
  • 14
  • 92
  • 150
  • 2
    Wow, thanks. That works. One question: how (or where?) do you find out that it needs to be userId_postId? – Tanin Jul 11 '15 at 16:14
  • 3
    When you request user or page posts via `/{user_or_page_id}/feed`, prior API versions return that format as value of the `id` field already … so I just tried if that worked with v2.4 ;-) – CBroe Jul 11 '15 at 16:34
  • 1
    Now I'm just getting an error `{\"message\":\"(#12) picture edge for this type is deprecated for versions v2.3 and higher\",\"type\":\"OAuthException\",\"code\":12,` – bzupnick Dec 01 '15 at 22:42
  • @bzupnick that might be a case of changed API behavior – did you get a default picture (question mark) before for some/all posts? If so, see https://developers.facebook.com/docs/apps/changelog#v2_3_changes – “Picture Error” – CBroe Dec 01 '15 at 22:56
  • @CBroe By any chance do you know how to create the userID_postID format and use them in GraphRequest in Android? I already have the user id and the post id, but I don't know how to use them in GraphRequest in Android. Thanks in advance. – Ashraf Alshahawy Jan 02 '16 at 11:05
  • new GraphRequest(mMainActivity.mAccessToken, "141108613290_10153513872748291", params, HttpMethod.GET, new GraphRequest.Callback() I used your example ids and it worked on Android, but when I use other ids from posts shared public by others, it returns "unsupported get request ....." Take this link for example, I extracted the ids from it and used in Graph API Explorer but it returns the same error, why? – Ashraf Alshahawy Jan 02 '16 at 11:40
  • https://m.facebook.com/story.php?story_fbid=10153244578850686&substory_index=94&id=700580685 – Ashraf Alshahawy Jan 02 '16 at 11:40
  • 4
    This is apparently no longer working `"Unsupported get request. Object with ID 'XXX_XXX' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api"` – logicbloke Nov 28 '16 at 19:41
  • 3
    @PhoenixNoor it works perfectly fine. Facebook themselves return this kind of ids via the API nowadays. Most likely your app does not have the necessary permission to read that particular object. – CBroe Nov 28 '16 at 19:46
  • For picture use /attachment node in the following format: https://graph.facebook.com/v2.8/[page_id]_[post_id]/attachments?access_token=xxx – heroin Jan 25 '17 at 18:49
  • @CBroe: I want to get the video details from the post in this type of url https://www.facebook.com/shreyaghoshal/posts/10155774118036484 . I get this link from the Facebook app in iOS device. Except this copied link and Facebook login user details i don't have any details about this url . Facebook version is above the 2.4 version. I used the code graph request to get the details like "/{postid}" it shows the (#12) singular statuses API is deprecated for versions v2.4 and higher. Please give suggestions and code to solve this issue. – Ajay Oct 11 '17 at 04:26
  • @Ajay as I explained, you need to replace the user name with the numeric id first, and then use `profileId_postId` – CBroe Oct 11 '17 at 15:31
  • @CBroe: Thank you for reply. Please give suggestion and code to get that user profileId too. I have only the url which is copied from the facebook App. – Ajay Oct 12 '17 at 05:41
2

Firstput userId underscore add postId /Likes to check Like status in facebook

userId_post_Id/Likes to fetch Likes Records

userId_post_Id/Comments to fetch Comments Records

    https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=303261006522998_751199848395776%2FLikes&version=v2.9

    **In this link Right side Get Token indide GetAccessToken to select Permission**

enter image description here

    303261006522998_751199848395776/Likes
    303261006522998_751199848395776/Comments

{
  "data": [
    {
      "id": "124778301449917",
      "name": "Manisha Gera"
    },
    {
      "id": "1680577265523548",
      "name": "Rubi Sharma"
    }
  ],
  "paging": {
    "cursors": {
      "before": "MTI0Nzc4MzAxNDQ5OTE3",
      "after": "MTY4MDU3NzI2NTUyMzU0OAZDZD"
    }
  }
}
Keshav Gera
  • 10,807
  • 1
  • 75
  • 53