4

Using the old REST API, you could do call https://api.facebook.com/method/pages.isAdmin to know if a user was the admin of a given page.

How can you do that using the Graph API? I can't find anything about it in the documentation and start to wonder if it's even possible.

marcgg
  • 65,020
  • 52
  • 178
  • 231
  • @Peter bailey: No, I'm actually using Facebooker for Ruby on Rails, but I'd say that this problem is tech agnostic since it's just calling an URL and parsing it. – marcgg Sep 02 '10 at 14:21

5 Answers5

3

You may be able to view that info in the accounts connection

Peter Bailey
  • 105,256
  • 31
  • 182
  • 206
  • 1
    oh that's pretty cool, thanks! It's too bad that you have to get all the pages of a user just to check if he's admin of one page though... – marcgg Sep 02 '10 at 14:28
  • link is no longer valid, probably it's deprecated by now. – Masroor Nov 03 '20 at 10:07
1
$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));
0

You can try this:

$page=$facebook->api('/[PAGE ID]?fields=access_token');
if (!$page['access_token'])
    echo "is not admin";
Julio Popócatl
  • 712
  • 8
  • 16
0

Another option would be to run FQL on page_admin table.

serg
  • 109,619
  • 77
  • 317
  • 330
0

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

Also see How can i get the admins user id of a page in facebook.?.

Community
  • 1
  • 1
Mike Lapinskas
  • 149
  • 2
  • 5