Search code examples
phpfacebookfacebook-graph-apifacebook-page

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


How can i get the admins user id of a page in facebook using grapg API .?

For eg: This will give the details of page KFC

https://graph.facebook.com/126380033352

{
  "id": "126380033352",
  "name": "I Love KFC",
  "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/50510_126380033352_4943708_s.jpg",
  "link": "http://www.facebook.com/Official.KFC",
  "likes": 543485,
  "category": "Food/beverages",
  "username": "Official.KFC",
  "founded": "1929",
  "about": "KFC United Kingdom. Finger Lickin' Good.",
  "can_post": true,
  "talking_about_count": 8965,
  "type": "page"
}

I need to get the user id of the page admin..? I have checked the permissions but i dont know how to get that .?


Solution

  • First: User must be a admin of that page.

    With "manage_pages" permission, request GET https://graph.facebook.com/[PAGE_ID]?fields=access_token In response will get a Page admin access_token. Now use the page admin access_token to request GET https://graph.facebook.com/[PAGE_ID]/admins

    In response you will get the list of admins, their id and usernames.

    Reference: http://developers.facebook.com/docs/reference/api/page/