/{group-id}
Represents a Facebook group. The /{group-id}
node returns a single group.
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
}];
OPEN
)user_groups
permission to retrieve any groups that the session user is a member of. Property Name | Description | Type |
---|---|---|
| The group ID |
|
| Information about the group's cover photo. |
|
| 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). |
|
You can't publish on this endpoint, however Facebook apps and games can create new app groups using a different edge.
You can't delete on this endpoint, however Facebook apps and games can be deleted using a different edge.
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
}];
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. |
|
If the update is successful true
, otherwise an error message.