获取 groupSetting
本文内容
命名空间:microsoft.graph
检索特定组设置对象的属性。 该设置可以是租户级别或特定于组的设置。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
列出租户范围的设置
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
Directory.Read.All、Directory.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
Directory.Read.All、Directory.ReadWrite.All
列出特定于组的设置
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
Group.Read.All、Group.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
Application
Group.Read.All、Group.ReadWrite.All
HTTP 请求
获取租户范围的设置。
GET /groupSettings/{groupSettingId}
获取特定于组的设置。
GET /groups/{groupId}/settings/{groupSettingId}
可选的查询参数
此方法支持 $select OData 查询参数 ,以帮助自定义响应。
名称
说明
Authorization
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和 groupSetting 对象。
示例
示例 1:获取特定组的组设置
请求
GET https://graph.microsoft.com/v1.0/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.Groups["{group-id}"].Settings["{groupSetting-id}"]
.Request()
.GetAsync();
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.Groups["{group-id}"].Settings["{groupSetting-id}"]
.Request()
.GetAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe')
.get();
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe')
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings("a06fa228-3042-4662-bd09-33e298da1afe")
.buildRequest()
.get();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings("a06fa228-3042-4662-bd09-33e298da1afe")
.buildRequest()
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupsById(&groupId).SettingsById(&groupSettingId).Get()
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupsById(&groupId).SettingsById(&groupSettingId).Get()
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings/$entity",
"id": "a06fa228-3042-4662-bd09-33e298da1afe",
"displayName": "Group.Unified.Guest",
"templateId": "08d542b9-071f-4e16-94b0-74abb372e3d9",
"values": [
{
"name": "AllowToAddGuests",
"value": "false"
}
]
}
示例 2:获取所有Microsoft 365组的组设置
请求
GET https://graph.microsoft.com/v1.0/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.GroupSettings["{groupSetting-id}"]
.Request()
.GetAsync();
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.GroupSettings["{groupSetting-id}"]
.Request()
.GetAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6')
.get();
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6')
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groupSettings("84af2ca5-c274-41bf-86e4-6e374ec4def6")
.buildRequest()
.get();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groupSettings("84af2ca5-c274-41bf-86e4-6e374ec4def6")
.buildRequest()
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupSettingsById(&groupSettingId).Get()
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupSettingsById(&groupSettingId).Get()
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings/$entity",
"id": "84af2ca5-c274-41bf-86e4-6e374ec4def6",
"displayName": "Group.Unified",
"templateId": "62375ab9-6b52-47ed-826b-58e47e0e304b",
"values": [
{
"name": "EnableMIPLabels",
"value": "true"
},
{
"name": "CustomBlockedWordsList",
"value": ""
},
{
"name": "EnableMSStandardBlockedWords",
"value": "true"
},
{
"name": "ClassificationDescriptions",
"value": ""
},
{
"name": "DefaultClassification",
"value": ""
},
{
"name": "PrefixSuffixNamingRequirement",
"value": "[Contoso-][GroupName]"
},
{
"name": "AllowGuestsToBeGroupOwner",
"value": "false"
},
{
"name": "AllowGuestsToAccessGroups",
"value": "true"
},
{
"name": "GuestUsageGuidelinesUrl",
"value": "https://privacy.contoso.com/privacystatement"
},
{
"name": "GroupCreationAllowedGroupId",
"value": ""
},
{
"name": "AllowToAddGuests",
"value": "true"
},
{
"name": "UsageGuidelinesUrl",
"value": ""
},
{
"name": "ClassificationList",
"value": ""
},
{
"name": "EnableGroupCreation",
"value": "true"
}
]
}