I have found restFB client library in spring for facebook graph api , i have to get page reviews and reviwers name and profile photo. I am searching for this in https://restfb.com/javadoc-3/com/restfb/types/Page.html , but couldn’t find any method for this
is it possible to get page reviews and reviewer’s name and profile photo url with restFB library?
2
Answers
Use facebook official api
https://developers.facebook.com/docs/graph-api/reference/page/ratings/
Getting the ratings is a bit more tricky.
Let’s assume you have a
FacebookClient
with the correct page access token. Then you can start a call like this:Then you can iterate over the connection. Check the
OpenGraphRating
object for the methods you can use.I suggest additionally to check the
open_graph_story
field, because with this you can get some more information. Then the request looks like this (for the ease of use I removed the otherOpenGraphRating
fields here).In this example you can access the fields with the
getOpenGraphStory
method that is part of theOpenGraphRating
object.