Not able to get Facebook Reviews through PHP SDK V4. Error: (#210) Subject must be a page -


i trying use php sdk v4 retrieve 'facebook page ratings' in website's page. created fb app, , got page access token graph api explorer.

as described in this link. code working when access page details

$request = new facebookrequest(   $session,   'get',   '/{page-id}' ); 

but when try retrieve ratings of facebook page described here-

$request = new facebookrequest(   $session,   'get',   '/{page-id}/ratings' ); 

i following error-

fatal error: uncaught exception 'facebook\facebookpermissionexception' message '(#210) subject must page.'.......

why that? please help!

you're getting error coz you're not using page access token api call.

getting page access token–

instead of using page access token graph api explorer, 1 api call. remember user must authorize app manage_pages permission. you'l l page access token in response of following call (demo)-

$request = new facebookrequest(   $session,   'get',   '/{page-id}?fields=access_token' ); 

ps, if required, can page access token of page authored never expires. see this answer.

using page access token call–

to ratings have use page access token api /{page-id}/ratings, this-

$request = new facebookrequest(   $session,   'get',   '/{page-id}/ratings?access_token='.$page_access_token  //use page access token obtained above step here ); 

note:

from v2.0 onwards, permissions other public_profile, email , user_friends need submitted review before can make app live; else wont able use them. testers/admin/developers of app able test permissions until permissions reviewed.

so, have submit login review before make app live. here details login review


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -