PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] Facebook PHP API v5.0 get detailed posts on group

 January 06, 2022     facebook-group, facebook-php-sdk, php     No comments   

Issue

I try to get every posts in group using

$request = $fb->request("GET","/1172154122867702/feed");

I can get the posts array from the group using $response->getDecodedBody(); but it just contain three property which are the message,id,and updated time.

Is it possible to get the name of the user that post the feed?

Thanks in advanced!


Solution

Available fields: https://developers.facebook.com/docs/graph-api/reference/v2.8/post

$request = $fb->request("GET","/1172154122867702/feed?fields=message,from");

It is called "Declarative Fields" and was introduces with v2.4 of the Graph API.



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing