Graph API Version

Group /{group-id}

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

Reading

Graph API Explorer
GET /v22.0/{group-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{group-id}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* 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();
/* 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)
  • user_groups permission to retrieve any groups that the session user is a member of.
  • App and game groups require an app access token to retrieve.

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

link

The group's website.

string

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.

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 /v22.0/{group-id} HTTP/1.1
Host: graph.facebook.com

cover_url=new-photo-url.jpg
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}',
    array (
      'cover_url' => 'new-photo-url.jpg',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{group-id}",
    "POST",
    {
        "cover_url": "new-photo-url.jpg"
    },
    function (response) {
      if (response && !response.error) {
        /* 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();
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 the update is successful true, otherwise an error message.

Edges

NameDescription

/admins

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

/docs

The docs in this group.

/events

The events in this group.

/feed

This group's feed.

/files

Files uploaded to this group.

/members

All of the users who are members of this group.