group: removeFavorite
Article
07/06/2023
11 contributors
Feedback
In this article
Namespace: microsoft.graph
Remove the group from the list of the current user's favorite groups. Supported for Microsoft 365 groups only.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Group.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
HTTP request
POST /groups/{id}/removeFavorite
Header
Value
Authorization
Bearer {token}. Required.
Prefer
return=minimal. If minimal response header is included in the request header, then a successful response returns 204 No Content code. Optional.
Request body
Do not supply a request body for this method.
Response
If successful, this method returns 200 OK response code. It does not return anything in the response body.
Example
Request
The following is an example of the request.
POST https://graph.microsoft.com/v1.0/groups/{id}/removeFavorite
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
await graphClient.Groups["{group-id}"].RemoveFavorite.PostAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
graphClient.Groups().ByGroupId("group-id").RemoveFavorite().Post(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
graphClient.groups("{id}")
.removeFavorite()
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->groups()->byGroupId('group-id')->removeFavorite()->post()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
await graph_client.groups.by_group_id('group-id').remove_favorite.post()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following is an example of the response.
HTTP/1.1 200 OK