Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
    • Graph API
    • FQL
    • Open Graph
    • Dialogs
    • Chat
    • Internationalization
    • Ads
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
  • PHP
  • More SDKs
  • Objects
    • Achievement(Instance)
    • Album
    • App and Game Groups
    • Application
    • Checkin
    • Comment
    • Domain
    • Errors
    • Event
    • Field Expansion
    • FriendList
    • Group
    • Insights
    • Link
    • Message
    • Note
    • Offer
    • Order
    • Page
    • Pagination
    • Payment
    • Photo
    • Pictures
    • Post
    • Privacy Parameter
    • Publishing
    • Question
    • QuestionOption
    • Realtime Updates
    • Review
    • Search
    • Selecting Results
    • Status message
    • Thread
    • User
    • Video

Group

Facebook APIs › Graph API › Group

A Facebook Group. The User, Page and Application objects have groups connections.

To read a Group, you need:

  • any valid access_token if the group is public (i.e. the group's privacy setting is OPEN)
  • user_groups permission for a user's non-public groups
  • friends_groups permission for a user's friend's non-public groups
  • Groups for Apps and Games require the use of an App access_token.

Example

The Facebook Developers Group:

https://graph.facebook.com/195466193802264


Fields

NameDescriptionPermissionsReturns
id

The group ID

generic access_token, user_groups, or friends_groups

string

icon

The URL for the group's icon

generic access_token, user_groups, or friends_groups

string containing a valid URL

cover

The URL for the group's cover photo

generic access_token, user_groups, or friends_groups

array containing a valid URL, cover_id and image offset

owner

The profile that created this group

generic access_token, user_groups, or friends_groups

object containing the id and name fields

name

The name of the group

generic access_token, user_groups, or friends_groups

string

description

A brief description of the group

generic access_token, user_groups, or friends_groups

string

link

The URL for the group's website

generic access_token, user_groups, or friends_groups

string containing a valid URL

privacy

The privacy setting of the group

generic access_token, user_groups, or friends_groups

string containing OPEN, CLOSED, or SECRET

updated_time

The last time the group was updated

generic access_token, user_groups, or friends_groups

string containing ISO-8601 date-time


Connections

NameDescriptionPermissionsReturns
events

This will return a list of events for the group.

User access_token

array of events with members of id, name, start_time, end_time and location.

feed

This group's wall.

any valid access_token, user_groups, or friends_groups

array of Post objects.

members

All of the users who are members of this group (can only currently return the first 500 members).

any valid access_token, user_groups, or friends_groups

array of objects containing id, and name, fields; some members will also have an administrator field.

picture

The profile picture of this group.

any valid access_token, user_groups, or friends_groups

HTTP 302 with the URL of the group's profile picture

docs

The docs in this group.

any valid access_token, user_groups, or friends_groups

array of objects containing id, from, subject, message, icon, updated_time, revision, can_edit, and can_delete fields.


Set Cover Photo

Please see the document on App and Game Groups for more information.

Applications can set the cover photo for a group by issuing a POST request to /GROUP_ID with an app access_token.

Name Description Type Required
cover_url The url for the cover photo. The image will be downloaded and added to the group's album and then used as a cover photo. string yes

If the action is successful, the response will contain true.


events

Get Events

Applications can get events for a group by issuing a GET request to /GROUP_ID/events with a user access_token.

If the action is successful, the response will contain:

Name Description Type
id The id of the event. string
name The name of the event string
start_time Start time of the event in ISO-8601 format. string
end_time End time of the event in ISO-8601 format. string
location Location of the event. string

Create Event

Users can create an event for a group by issuing a POST request to /GROUP_ID/events with a user access_token. The user needs the create_event permission.

All event times are ISO-8601 formatted strings (e.g., '2012-07-04', '2012-07-04T19:00:00-0700'). Event times containing the time must have the UTC offset.

Parameter Description Type Required
name Name of event. string yes
start_time Start time of the event in ISO-8601 format. string yes
end_time End time of the event in ISO-8601 format. string no
description Description of the event. string no
location Location of the event. string no
location_id Facebook Place ID of the place for the event. string no

If the create is successful, the response will contain:

Name Description Type
id The new event ID string

feed

This connection corresponds to the Group's wall. You can create a link, post or status message by issuing an HTTP POST request to the /GROUP_ID/feed connection.

links

Create

Users can post a link on the Group's wall by issuing an HTTP POST request to /GROUP_ID/feed with the publish_actions permissions and the following parameters. (publish_stream will also work, but you should use publish_actions.) This requires a user access_token.

Parameter Description Type Required
link Link URL string yes
message Link message string no

The other fields are taken from the metadata of the page URL given in the 'link' param.

If the create is successful, you get the following return.

Name Description Type
id The new link ID string

posts

Create

You can create a post on a Group's wall by issuing an HTTP POST request to /GROUP_ID/feed with the publish_stream permissions and the following parameters.

Parameter Description Type Required
message Post message string either message or link
link Post URL string either message or link
actions Post actions array of name/link pairs no
picture Post thumbnail image (can only be used if link is specified) string no
name Post name (can only be used if link is specified) string no
caption Post caption (can only be used if link is specified) string no
description Post description (can only be used if link is specified) string no

If the create is successful, you get the following return.

Name Description Type
id The new post ID string

statuses

Create

You can post a status message on a Group's wall by issuing an HTTP POST request to /GROUP_ID/feed with the publish_stream permissions and the following parameters.

Parameter Description Type Required
message Status Message content string yes

If the create is successful, you get the following return.

Name Description Type
id The new status message ID string

members

Please see the App and Game Groups document for more information on these methods.

Read

Applications can get the list of members that belong to a group by issuing a GET request to /GROUP_ID/members with an app access_token.

If the action is successful, the response will contain:

Name Description Type
id The id of the user. string
name The name of the user. string
administrator The user is administrator of the group. boolean

Invite User

Applications can invite users to a group by issuing a POST request to /GROUP_ID/members/USER_ID with an app access_token.

Note that user being invited must be a user of the application. The user will be sent a notification saying that they have been invited to the group. The notification will take them to the group page. Users can only be invited once. Subsequent invites will fail.

Optionally, a from parameter can be passed in the request. If the from parameter is included, then the invite request will look like it was sent by the from user. If this parameter is not included, then the invite request will appear to come from the application. Invites sent on behalf of a user can only be sent to the sender's friends.

Parameter Description Type Required
from The ID of the user doing the inviting. string no

If the action is successful, the response will contain true.

Remove Member

Users can be removed from a group by issuing a DELETE request to /GROUP_ID/members/USER_ID with an app access_token.

If the action is successful, the response will contain true.

Promote Admin

A member of a group can be promoted to admin by issuing a POST request to /GROUP_ID/admins/USER_ID with an app access_token. The user must be a member of the group. The user will receive a notification that they have been made an admin for the group.

If the action is successful, the response will contain true.

Remove Admin

An admin of a group can be demoted to user by issuing a DELETE request to /GROUP_ID/admins/USER_ID with an app access_token.

If the action is successful, the response will contain true.

Updated about 2 months ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy