get Facebook Graph api page review

I'm trying to get review/rating from certain place whos fb page can look like this i.e :

https://www.facebook.com/pages/Dell-Rheas-Chicken-Basket/183254918389428

So id of this place/page is 183254918389428

And you can get the details of this place but not rating/review:

https://graph.facebook.com/183254918389428

I found somewhere on this forum that you could get review from page like this :

https://graph.facebook.com/183254918389428/tabs/reviews?access_token=xxx

But I always get no data :

{
   "data": [

   ]
}

So I'm not trying to get app review/rating but for certain place.

Answers


You'd need a page access token to fetch reviews and ratings. Here is a very good short tutorial on getting a page access token: Obtaining page access token.

https://www.facebook.com/dialog/oauth?client_id=<APP_ID>&redirect_uri=<REDIRECT_URL>&scope=manage_pages&state=<STATE>

This will generate you a CODE, use that code in:

https://graph.facebook.com/oauth/access_token?client_id=<APP_ID>&client_secret=<APP_SECRET>&code=<CODE>

This will return you a json response containing short lived user access token.

Next, use the short lived user token to get long lived user token:

https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=<APP_ID>&client_secret=<APP_SECRET>&fb_exchange_token=<SHORT_LIVED_TOKEN>

This will return another json containing the long lived user token, you can now exchange it for page access token:

https://graph.facebook.com/me/accounts?access_token=<LONG_LIVED_TOKEN>

This will return you a json with page access token of the page(s) associated with that user account. Use this page access token to fetch ratings and reviews by passing it to:

https://graph.facebook.com/StoneArmsInc/ratings?access_token=<page_access_token>

And you will get all the ratings posted on facebook for that page.

Hope, this helps someone. :)


The ratings edge has the reviews in it now, but you need to have a page access token to get it.

The end point is documented here:

https://developers.facebook.com/docs/graph-api/reference/page/ratings

Note that to get the page access token you have to use a user token from someone who is an admin of the page. I don't know if that's a problem for you.


The API for Page reviews hasn't been released yet. We are working on it. Please keep checking for the updates here.

Update: API for fetching page reviews can be found here: https://developers.facebook.com/docs/graph-api/reference/page/ratings/


Need Your Help

How to limit a table cell to one line of text using CSS?

css html-table overflow

I have a table of users where each row contains their names, e-mail address, and such. For some users this row is one text line high, for some others two, etc. But I would like that each row of the...