14

Has anyone seen a full example of how to pull facebook reviews using the graph api.

According to the docs: A page access token is required to retrieve this data.

I have code that asks a user to login already and gets an auth token which I can use to post a message to their facebook feed. Is there an additional step I need to do to be able to read their reviews/ratings?

Here is an example of the code to post to their feed/page.

response = Curl.post("https://graph.facebook.com/#{page_id}/feed", {
    :message => message,
    :access_token => auth_token
  })

Thanks

user3587846
  • 141
  • 1
  • 1
  • 3

2 Answers2

14

If you're referring to Page Ratings (different from App Reviews!), then the endpoint is

GET /{page_id}/ratings

as described here: https://developers.facebook.com/docs/graph-api/reference/page/ratings You'll need a Page Access Token for this.

Where I get a little bit confused is that you mention that you want to

read their reviews/ratings

In that case it's something else, because afaik it's currently not possible to query the User's Page ratings via Graph API or FQL. It's was only possible to query App Reviews via FQL (see https://developers.facebook.com/docs/reference/fql/review/) (Update: FQL is no longer available since 2016)

Community
  • 1
  • 1
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • how to get that page_id? @Tobi – Sagar Patel Jun 18 '18 at 06:31
  • page_id is the page url, such as https://facebook.com/ExamplePage/ The page_id in this example would be ExamplePage – Sean _space Nov 26 '18 at 12:22
  • 2
    Anyone else notice that the field reviewer does not return any data? https://developers.facebook.com/docs/graph-api/reference/recommendation/ – Andrew Schultz Jan 23 '19 at 04:20
  • 3
    @AndrewSchultz AFAIK: The reviewer field now requires you to use a live version of the app with "manage_pages"-permissions. If you use an app that is in developer mode the reviewer field is empty unless the reviewer is a user of the app. I hope this gets solved because I doubt facebook will grant me access to manage_pages live. – user158443 Feb 06 '19 at 15:53
  • Is there a way to get review id along with the response? – Ishan Fernando Jan 26 '23 at 04:36
1

You need to set permission in the app to access the {GET /{page_id}/ratings} API. The permission is common for /page/comments, /page/posts, /page/ratings, /page/tagged, and the permission name is "pages_read_user_content"

https://developers.facebook.com/docs/permissions/reference/pages_read_user_content

TechnoPHP
  • 11
  • 1