1

I am using this solution to select an individual post from a user's feed.

I am using PHP Facebook SDK on the latest version 5.7.

Previously this had worked with no problem, I made my request like:

$response = $this->fb->get(
  '/'.$user['id']. '_' .$post_id.'/?fields=id,description,name,full_picture',
   $this->get_access_token()
);

And I would get all the fields. However, over the last few months, this has stopped working.

The access_token requests the following permissions:

['user_events', 'user_posts']

I can't find any documentation on the solution outlined in the Stack Overflow post. So I am not sure if I need any more permissions.

I do not get an error when sending this request, I just get the ID back and nothing else. This can be confirmed in the Graph API Explorer:

Graph API Explorer

The v5.0 docs show that when requesting a post I can get full_picture, name and description without mentioning any additional permissions required.

However that same page recommends making the request with just the post ID:

/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{post-id}',
    '{access-token}'
  );
}

Which does not work, you

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

The error does mention statuses and not posts but I am not sure how to distinguish the difference between those, I figured they were the same.

Has anyone else stumbled across this and found a solution?

Ian Jamieson
  • 4,376
  • 2
  • 35
  • 55

1 Answers1

1

It turns out that the fact it was called status was important. I made a request to the users feed, and noticed that some older posts were returning the data that I needed. I had a look through the list of fields and appended message and type to get the following response:

enter image description here

Not very well documented I guess. But got there in the end, hopefully this can help someone else in future.

Ian Jamieson
  • 4,376
  • 2
  • 35
  • 55