Graph API Version

Group /{group-id}

Represents a Facebook group. The /{group-id} node returns a single group.

To read the Facebook Groups a person belongs to use the endpoint /{user-id}/groups.

Reading

Graph API Explorer
GET /v2.7/{group-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{group-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{group-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • Any valid access token if the group is public (i.e. the group's privacy setting is OPEN)
  • The user_managed_groups permission can be used to read the group content for a group in which the user is an admin. This permission also allows the app to post as the user in the group if the app is also granted the publish_actions permission. An app granted this permission can continue to use these capabilities even if the user stops being an admin of the group, although the user can remove the app from the group manually.
  • App and game groups require an app access token.

Login Review: user_managed_groups

To use the user_managed_groups permission you need to submit your app for review.

Learn more about Login Review

Fields

Property NameDescriptionType

id

The group ID

string

cover

Information about the group's cover photo.

CoverPhoto

id

ID of the Photo that represents this cover photo.

string

source

URL to the Photo that represents this cover photo.

string

offset_y

The vertical offset in pixels of the photo from the bottom.

int

offset_x

The horizontal offset in pixels of the photo from the left.

int

description

A brief description of the group.

string

email

The email address to upload content to the group. Only current members of the group can use this.

string

icon

The URL for the group's icon.

string

member_request_count

The number of pending member requests. If the token is for an administrator, this is the total number of outstanding requests. If the token is for a group member, this will return the number of friends who have requested membership and also use the same app that is making the request.

int

name

The name of the group.

string

owner

The profile that created this group.

User|Page

parent

The parent of this group, if it exists.

Group|Page|App

privacy

The privacy setting of the group. Possible values:

  • CLOSED
  • OPEN
  • SECRET

string

updated_time

The last time the group was updated (this includes changes in the group's properties and changes in posts and comments if the session user can see them).

datetime

Publishing

You can't publish on this endpoint, however Facebook apps and games can create new app groups using a different edge.

Deleting

You can't delete on this endpoint, however Facebook apps and games can be deleted using a different edge.

Updating

An app that created an app or game group can update that groups cover photo:

POST /v2.7/{group-id} HTTP/1.1
Host: graph.facebook.com

cover_url=new-photo-url.jpg
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'POST',
  '/{group-id}',
  array (
    'cover_url' => 'new-photo-url.jpg',
  )
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
Bundle params = new Bundle();
params.putString("cover_url", "new-photo-url.jpg");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"cover_url": @"new-photo-url.jpg",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • An app access token of the app that created the group is required.

Fields

NameDescriptionType

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. This field is required.

string

Response

If successful:

{
  "success": true
}

Otherwise a relevant error message will be returned.

Edges

NameDescription

/admins

The admins of a group. This edge is only available to app and game groups.

/albums

The photo albums created in a group.

/docs

The docs in this group.

/events

The events in this group.

/feed

This group's feed.

/files

Files uploaded to this group.

/live_videos

Live videos for a Facebook Group.

/members

All of the users who are members of this group.

/photos

Upload photos to a group's feed.

/videos

Videos for a Facebook Group.