How to get if the user is the administrator of the page (isAdmin) using the Facebook Graph API?

Using the old REST API, you can call https://api.facebook.com/method/pages.isAdmin to find out if the user was the administrator of this page.

How can you do this using the Graph API? I can’t find anything about this in the documentation and start to wonder if this is possible.

+4
source share
5 answers

You may be able to view this information in connecting accounts

+3
source
 $session_key = $_REQUEST['fb_sig_session_key'];//maybe there is a better way to get this $access_token = $facebook->getAccessToken(); $is_admin = $facebook->api(array('method'=>'pages.isadmin', 'page_id'=>'YOUR_PAGE_ID', 'session_key'=>$session_key, 'access_token'=>$access_token)); 
+1
source

Another option is to run FQL in the page_admin table.

0
source

You can try the following:

 $page=$facebook->api('/[PAGE ID]?fields=access_token'); if (!$page['access_token']) echo "is not admin"; 
0
source

From FB docs: GET /v2.2/{page-id}/roles/{user-id}

Also see How can I get the user ID of facebook page administrators.? .

0
source

All Articles