Post to Facebook Group Wall PHP API

Since I wrote tutorial Post to Facebook Page Wall, few people have asked me to write a tutorial that will post messages on Group wall as well. If you look at previous examples, you should be pretty clear how everything works, posting message or link works very similar way as before, by issuing HTTP POST request to the GROUP_ID/feed.

Before we begin, I suggest you have a look at this article : Post to Facebook Page Wall, I have only made few modifications to that previous examples, which are explained below:

Listing user Groups

To get user group information, user must allow user_groups permission. Once this permission is granted, your application can acquire user group information using FQL (Facebook Query Language). If you look at index.php, you can see I have modified FQL to list all groups where user is a member.

 
1
select gid, name from group where gid IN (SELECT gid FROM group_member WHERE uid=23430809234)

To list only groups where user is administrator :

 
1
select gid, name from group where gid IN (SELECT gid FROM group_member WHERE uid=23430809234 AND administrator='true')

Post Message

Posting message to groups works similar way as posting to user pages wall. Difference here is, we use Group ID instead of Page ID in $post_url.

Download Demo

Related Articles:

Article by on October 31, 2012 Tagged under Tagged under , . If you like this article, please consider sharing it.

9 Thoughts

  1. Dear how can i post ( message status ) and ( photos ) for facebook app user’s wall

    I found some app when i login in app send me auto post in first and every time make status on my wall

    if u want example i can send u link

  2. Hello,

    I am new in facebook graph apps so i want to sent my testimonial data or image to my facebook wall if admin gives permission to show .please help me ….

    Thanks
    Rb swain

  3. hey, i tried looping through all of the group ids for making a script to post to my groups, the problem is, my website totally freezes when i’m using the SDK and it takes forever to complete some actions…. what am i doing wrong ? why is FB SDK freezing my entire server?

Leave a Comment

Get your comment picture from Gravatar.com.
Your email address will not be published. Required fields are marked *