Get post details by post id using open graph

Dor

By using this code:

$url2 = "https://graph.facebook.com/{$group_id}/feed?limit=500&access_token=XXXXXXXXXXXXX";
$data = json_decode(file_get_contents($url2));

I get json like this:

stdClass Object
(
    [message] => bla bla bla bla bla bla
    [updated_time] => 2016-12-23T08:31:25+0000
    [id] => 000000000000_111111111111
)

The first part (0000...0) is the group id. The second part (1111..1) is the post id. I need the details of the post owner (id, name, profile picture).

You can help me please? Thanks.

luschn

The API reference tells you which fields you can get for a post: https://developers.facebook.com/docs/graph-api/reference/v2.8/post

For example, to get the name of the creator:

/{group-id}/feed?limit=500&fields=id,from

...or if you want to get profile pictures too:

/{group-id}/feed?limit=500&fields=id,from{id,name,picture}

It is called "Declarative Fields" and came with v2.4 of the Graph API. You need to specify the fields you want to get in the result.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get author ID of a post in wordpress

From Dev

Posting to open graph does not show object title in the post

From Dev

Post Image to the Facebook using Graph API

From Dev

How to delete post in facebook by id using php, graph API

From Dev

Can we get the share count of a post in fb using graph api v2.3?

From Dev

Post photo on Facebook group using graph api

From Dev

How to post a video using Facebook Graph API

From Dev

Wordpress get post id with matched post content

From Dev

Get Post Insights for multiple posts in one call using Graph Api 2.7

From Dev

Getting details of likes and comments of a particular post id in ios

From Dev

How to get FB like count for each post while pulling the feed via Open Graph API?

From Dev

Get author ID of a post in wordpress

From Dev

Facebook-Graph-API get post by post id

From Dev

Using POST instead of GET

From Dev

Get Wordpress data by Post ID

From Dev

Get id of post with array in wordpress

From Dev

Get one facebook post by ID

From Dev

Get URL (Link) for facebook post using post ID

From Dev

Post Image to the Facebook using Graph API

From Dev

GRAPH API:how to get hyperlinks from a post

From Dev

Can we get the share count of a post in fb using graph api v2.3?

From Dev

Post photo on Facebook group using graph api

From Dev

select post where id is not get_the_ID()

From Dev

Using $_POST or $_GET with Modal, Refresh based on ID

From Dev

get post Id in plugin

From Dev

How to get details for a specific post by user?

From Dev

Using JQuery $.GET and $.POST

From Dev

How to get the post thumbnail with global post ID

From Dev

Open Random Post Using Javascript

Related Related

HotTag

Archive