A Facebook Group. The User, Page and Application objects have groups connections.
To read a Group, you need:
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 groupsfriends_groups permission for a user's friend's non-public groupsaccess_token.The Facebook Developers Group:
https://graph.facebook.com/195466193802264
| Name | Description | Permissions | Returns |
id | The group ID | generic |
|
icon | The URL for the group's icon | generic |
|
cover | The URL for the group's cover photo | generic |
|
owner | The profile that created this group | generic | object containing the |
name | The name of the group | generic |
|
description | A brief description of the group | generic |
|
link | The URL for the group's website | generic |
|
privacy | The privacy setting of the group | generic |
|
updated_time | The last time the group was updated | generic |
|
| Name | Description | Permissions | Returns |
| events | This will return a list of events for the group. | User |
|
| feed | This group's wall. | any valid |
|
| members | All of the users who are members of this group (can only currently return the first 500 members). | any valid |
|
| picture | The profile picture of this group. | any valid | HTTP 302 with the URL of the group's profile picture |
| docs | The docs in this group. | any valid |
|
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.
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 |
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 |
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.
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 |
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 |
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 |
Please see the App and Game Groups document for more information on these methods.
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 |
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.
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.
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.
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.