Question:

By query the "/me/groups" connection for the current user via the Graph API, I can get a list of groups that the user is a member of. However, I want to get the list of groups that the user created (i.e. he owns the groups). Can this be done?

 

 

Answer:

Appreciate if you can like this page if you find it useful! - Click "Like"

To get the required list,

  • First query the "me/groups" connection with the field "owner" included, i.e. querying "/me/groups?fields=owner".

    Graph API will return you with something like:
'data' ...
   '0' ...
     'owner' ...
         'name' => "Chun Yi Aaliyah Lee"
         'id' => "100000118916068"
     'id' => "133243716700346"
   '1' ...
     'owner' ...
          'name' => "Eddy Chan"
          'id' => "100000704282029"
     'id' => "132104783469314" 
  • Then for each of group returned, compare the owner id with the user id of the current user.

 

 

Find my FAQ on Facebook Development useful? Download the PDF for all the FAQs HERE!