Reputation: 11
I am trying to implement Facebook's Graph API in to fetch ratings and reviews from Facebook page. The type of my app is a Business App. Am able to pull the page likes but unable to pull reviews and ratings. As per my understanding the facebook reviews can be given when giving rating to a page and the API endpoint for getting ratings is
{page_id}/ratings
But I get this when I hit the endpoint
{
"error": {
"message": "(#283) Requires pages_read_user_content permission to manage the object",
"type": "OAuthException",
"code": 283,
"fbtrace_id": "ArxjZMuaMR6yXBEOBisJI8i"
}
}
As I understand I need to verify my business with Facebook in order to get access to this endpoint. But my question is Am I hitting the right API?
Or is there another endpoint which fetches the reviews. Any help on this will be appreciated.
Upvotes: 0
Views: 888
Reputation: 11
Figured it out.
Step 1 : You have to generate an access_token for the facebook account. While doing this you need to ask for the page_read_user_content permission.
Step 2 : The access_token can be used to get all the pages related to the account.
me/accounts
This will return all the pages and ids associated with those pages. This will also return a Page Access Token to that page.
Step 3 : You can get the ratings and reviews for your page with this access token and page id
{page_id}/ratings
Upvotes: 1