名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
プライバシー設定を更新して、指定した種類の分析情報をorganizationに表示または返します。 設定の種類は、連絡先の分析情報、項目の分析情報、またはユーザーの分析情報です。
organizationの分析情報のプライバシーのカスタマイズの詳細については、次を参照してください。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
次の表は、サポートされている各リソースの種類でこの API を呼び出すために必要な最小特権のアクセス許可またはアクセス許可を示しています。
ベスト プラクティスに従って、最小限の特権のアクセス許可を要求します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Organization.ReadWrite.All |
AgentIdUser.ReadWrite.All、AgentIdUser.ReadWrite.IdentityParentedBy、User.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
Organization.ReadWrite.All |
注意事項なし。 |
organizationのアイテム分析情報の設定を更新するには
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
organizationのユーザー分析情報の設定を更新するには
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Organization.ReadWrite.All |
AgentIdUser.ReadWrite.All、AgentIdUser.ReadWrite.IdentityParentedBy、User.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
サポートされていません。 |
メモ: この操作に委任されたアクセス許可を使用して連絡先、アイテム、またはユーザーの分析情報を更新するには、サインインしているユーザーにグローバル管理者ロールが必要です。
HTTP 要求
連絡先分析情報の設定を更新するには:
PATCH /organization/{organizationId}/settings/contactInsights
アイテム分析情報の設定を更新するには:
PATCH /admin/people/itemInsights
ユーザー分析情報の設定を更新するには:
PATCH /organization/{organizationId}/settings/peopleInsights
| ヘッダー |
値 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json |
要求本文
要求本文で、更新するプロパティの値 のみを 指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
| プロパティ |
型 |
説明 |
| disabledForGroup |
文字列 |
指定した種類の分析情報がそのメンバーに対して無効になっている、Microsoft Entra グループの ID。 既定値は empty です。 省略可能。 |
| isEnabledInOrganization |
ブール型 |
true指定した分析情報の種類がorganizationに対して有効になっている場合は、指定した分析情報の種類が例外なしですべてのユーザーに対して無効になっている場合にfalseします。 既定値は true です。 省略可能。 |
メモ: 要求本文に含める場合、この操作では disabledForGroup プロパティの値は確認されません。
disabledForGroup プロパティを String に設定した場合、この操作は対応するMicrosoft Entra グループの存在をチェックしません。 つまり、disabledForGroup を、その後存在しない、または削除されたMicrosoft Entra グループに設定した場合、この操作ではグループ メンバーシップを特定できず、特定のユーザーのアイテムまたはユーザーの分析情報を無効にすることはできません。
isEnabledInOrganization が true に設定されている場合、操作により、organization内のすべてのユーザーに対して、指定した種類の分析情報が有効になります。
応答
成功した場合、このメソッドは応答コード 200 OK と、応答本文に insightsSettings オブジェクトを返します。
例
要求
次の例は、管理者が isEnabledInOrganization プロパティを更新して、指定したorganizationの連絡先分析情報を有効にする方法を示しています。isEnabledInOrganization の既定値はfalseであり、連絡先の分析情報を無効にします。 この例では、disabledForGroup プライバシー設定を設定して、特定のMicrosoft Entra グループ内のユーザーの連絡先分析情報の表示を禁止します。
PATCH https://graph.microsoft.com/beta/organization/{organizationId}/settings/contactInsights
Content-type: application/json
{
"isEnabledInOrganization": true,
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new InsightsSettings
{
IsEnabledInOrganization = true,
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Organization["{organization-id}"].Settings.ContactInsights.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewInsightsSettings()
isEnabledInOrganization := true
requestBody.SetIsEnabledInOrganization(&isEnabledInOrganization)
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
contactInsights, err := graphClient.Organization().ByOrganizationId("organization-id").Settings().ContactInsights().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
InsightsSettings insightsSettings = new InsightsSettings();
insightsSettings.setIsEnabledInOrganization(true);
insightsSettings.setDisabledForGroup("edbfe4fb-ec70-4300-928f-dbb2ae86c981");
InsightsSettings result = graphClient.organization().byOrganizationId("{organization-id}").settings().contactInsights().patch(insightsSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const insightsSettings = {
isEnabledInOrganization: true,
disabledForGroup: 'edbfe4fb-ec70-4300-928f-dbb2ae86c981'
};
await client.api('/organization/{organizationId}/settings/contactInsights')
.version('beta')
.update(insightsSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\InsightsSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InsightsSettings();
$requestBody->setIsEnabledInOrganization(true);
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$result = $graphServiceClient->organization()->byOrganizationId('organization-id')->settings()->contactInsights()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
$params = @{
isEnabledInOrganization = $true
disabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
Update-MgBetaOrganizationSettingContactInsight -OrganizationId $organizationId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.insights_settings import InsightsSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = InsightsSettings(
is_enabled_in_organization = True,
disabled_for_group = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
)
result = await graph_client.organization.by_organization_id('organization-id').settings.contact_insights.patch(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"isEnabledInOrganization": true,
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
例 2: 項目分析情報の設定を更新する
要求
次の例は、特定のMicrosoft Entra グループ内のユーザーのアイテム分析情報の表示を禁止するために、管理者が disabledForGroup プライバシー設定を更新する方法を示しています。
PATCH https://graph.microsoft.com/beta/admin/people/itemInsights
Content-type: application/json
{
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new InsightsSettings
{
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.People.ItemInsights.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewInsightsSettings()
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
itemInsights, err := graphClient.Admin().People().ItemInsights().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
InsightsSettings insightsSettings = new InsightsSettings();
insightsSettings.setDisabledForGroup("edbfe4fb-ec70-4300-928f-dbb2ae86c981");
InsightsSettings result = graphClient.admin().people().itemInsights().patch(insightsSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const insightsSettings = {
disabledForGroup: 'edbfe4fb-ec70-4300-928f-dbb2ae86c981'
};
await client.api('/admin/people/itemInsights')
.version('beta')
.update(insightsSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\InsightsSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InsightsSettings();
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$result = $graphServiceClient->admin()->people()->itemInsights()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
$params = @{
disabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
Update-MgBetaAdminPeopleItemInsight -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.insights_settings import InsightsSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = InsightsSettings(
disabled_for_group = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
)
result = await graph_client.admin.people.item_insights.patch(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
例 3: ユーザーの分析情報の設定を更新する
要求
次の例は、特定のMicrosoft Entra グループ内のユーザーの分析情報の表示を禁止するために、管理者が disabledForGroup プライバシー設定を更新する方法を示しています。
PATCH https://graph.microsoft.com/beta/organization/{organizationId}/settings/peopleInsights
Content-type: application/json
{
"isEnabledInOrganization": true,
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new InsightsSettings
{
IsEnabledInOrganization = true,
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Organization["{organization-id}"].Settings.PeopleInsights.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewInsightsSettings()
isEnabledInOrganization := true
requestBody.SetIsEnabledInOrganization(&isEnabledInOrganization)
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
peopleInsights, err := graphClient.Organization().ByOrganizationId("organization-id").Settings().PeopleInsights().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
InsightsSettings insightsSettings = new InsightsSettings();
insightsSettings.setIsEnabledInOrganization(true);
insightsSettings.setDisabledForGroup("edbfe4fb-ec70-4300-928f-dbb2ae86c981");
InsightsSettings result = graphClient.organization().byOrganizationId("{organization-id}").settings().peopleInsights().patch(insightsSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const insightsSettings = {
isEnabledInOrganization: true,
disabledForGroup: 'edbfe4fb-ec70-4300-928f-dbb2ae86c981'
};
await client.api('/organization/{organizationId}/settings/peopleInsights')
.version('beta')
.update(insightsSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\InsightsSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InsightsSettings();
$requestBody->setIsEnabledInOrganization(true);
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$result = $graphServiceClient->organization()->byOrganizationId('organization-id')->settings()->peopleInsights()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
$params = @{
isEnabledInOrganization = $true
disabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
Update-MgBetaOrganizationSettingPersonInsight -OrganizationId $organizationId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.insights_settings import InsightsSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = InsightsSettings(
is_enabled_in_organization = True,
disabled_for_group = "edbfe4fb-ec70-4300-928f-dbb2ae86c981",
)
result = await graph_client.organization.by_organization_id('organization-id').settings.people_insights.patch(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"isEnabledInOrganization": true,
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}