CARVIEW |

Group /{group-id}
Represents a Facebook group. The /{group-id}
node returns a single group.
Reading
GET /v23.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 Name | Description | Type |
---|---|---|
| The group ID |
|
| Information about the group's cover photo. |
|
| ID of the Photo that represents this cover photo. |
|
| URL to the Photo that represents this cover photo. |
|
| The vertical offset in pixels of the photo from the bottom. |
|
| The horizontal offset in pixels of the photo from the left. |
|
| A brief description of the group. |
|
| The email address to upload content to the group. Only current members of the group can use this. |
|
| The URL for the group's icon. |
|
| The group's website. |
|
| The name of the group. |
|
| The profile that created this group. | |
| The parent of this group, if it exists. | |
| The privacy setting of the group. |
|
| 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). |
|
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 /v23.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
Name | Description | Type |
---|---|---|
| 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. |
|
Response
If the update is successful true
, otherwise an error message.