Facebook Graph API + Facebook Pages

后端 未结 9 1590
温柔的废话
温柔的废话 2021-02-06 09:17

Using Facebook\'s Graph API, given a username xyz (assuming they\'ve authenticated my site), how do I get a list of all of the facebook pages that the user administers?

9条回答
  •  悲&欢浪女
    2021-02-06 09:51

    Use an fql query! That is the best way to get the pages for which the user is admin. You will also be able to restrict the names also. i.e pages with empty names A sample fql query which gives you the page details as well.

    SELECT page_id,page_url,name,pic_square FROM page WHERE page_id IN (SELECT page_id FROM page_admin WHERE uid = " + **UserId** + ") and name!='' 
    

    UserId -- Id of the admin

    NOTE This method will not work from version 2.1 of graph api as fql was deprecated from that version onwards

提交回复
热议问题