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
  • 62,686
  • 49
  • 174
  • 225
  • @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
  • 103,526
  • 30
  • 178
  • 200
  • 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
  • 618
  • 6
  • 14
0

Another option would be to run FQL on page_admin table.

serg
  • 106,723
  • 76
  • 306
  • 327
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
  • 139
  • 2
  • 5