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
On Facebook, page owners cannot remove individual reviews themselves. However, users can flag a review to notify Facebook's team to remove the reviews. But, users can only flag a review if it has at least one comment on it.
In the newest version of the Graph API (v2. 9), we're announcing features that simplify development, making it even easier to build apps and experiences with Facebook. We're providing free access to over 140 million places around the world, the same data that powers Facebook, Instagram, and Messenger.
$request = $fb->request('GET', '/'. $page_id. '/'); // Send the request to Graph try { $response = $fb->getClient()->sendRequest($request); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' .
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With