名前空間: microsoft.graph
profilePropertySetting オブジェクトのプロパティを更新します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
重要
この操作に委任されたアクセス許可を使用するには、サインインしているユーザーにPeople管理者ロールが必要です。
HTTP 要求
PATCH /admin/people/profilePropertySettings/{profilePropertySettingId}
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、更新するプロパティの値 のみを 指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
| プロパティ |
型 |
説明 |
| displayName |
文字列 |
プロパティ レベル設定の名前。 省略可能。 |
| name |
String |
プロパティ レベル設定のその他の名前。 下位互換性のため。 省略可能。 |
| prioritizedSourceUrls |
String collection |
organization内のデータ優先順位で並べ替えられた、優先順位付けされたプロファイル ソース URL のコレクション。 必須です。 |
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で更新された profilePropertySetting オブジェクトを返します。
例
要求
次の例は要求を示しています。
PATCH https://graph.microsoft.com/v1.0/admin/people/profilePropertySettings/00000000-0000-0000-0000-000000000001
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profilePropertySetting",
"prioritizedSourceUrls": [
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ProfilePropertySetting
{
OdataType = "#microsoft.graph.profilePropertySetting",
PrioritizedSourceUrls = new List<string>
{
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')",
},
};
// 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.ProfilePropertySettings["{profilePropertySetting-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewProfilePropertySetting()
prioritizedSourceUrls := []string {
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')",
}
requestBody.SetPrioritizedSourceUrls(prioritizedSourceUrls)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
profilePropertySettings, err := graphClient.Admin().People().ProfilePropertySettings().ByProfilePropertySettingId("profilePropertySetting-id").Patch(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ProfilePropertySetting profilePropertySetting = new ProfilePropertySetting();
profilePropertySetting.setOdataType("#microsoft.graph.profilePropertySetting");
LinkedList<String> prioritizedSourceUrls = new LinkedList<String>();
prioritizedSourceUrls.add("https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')");
prioritizedSourceUrls.add("https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')");
profilePropertySetting.setPrioritizedSourceUrls(prioritizedSourceUrls);
ProfilePropertySetting result = graphClient.admin().people().profilePropertySettings().byProfilePropertySettingId("{profilePropertySetting-id}").patch(profilePropertySetting);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const profilePropertySetting = {
'@odata.type': '#microsoft.graph.profilePropertySetting',
prioritizedSourceUrls: [
'https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr1\')',
'https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr2\')'
]
};
await client.api('/admin/people/profilePropertySettings/00000000-0000-0000-0000-000000000001')
.update(profilePropertySetting);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ProfilePropertySetting;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ProfilePropertySetting();
$requestBody->setOdataType('#microsoft.graph.profilePropertySetting');
$requestBody->setPrioritizedSourceUrls(['https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr1\')', 'https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr2\')', ]);
$result = $graphServiceClient->admin()->people()->profilePropertySettings()->byProfilePropertySettingId('profilePropertySetting-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.profile_property_setting import ProfilePropertySetting
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ProfilePropertySetting(
odata_type = "#microsoft.graph.profilePropertySetting",
prioritized_source_urls = [
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')",
],
)
result = await graph_client.admin.people.profile_property_settings.by_profile_property_setting_id('profilePropertySetting-id').patch(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profilePropertySetting",
"id": "00000000-0000-0000-0000-000000000001",
"displayName": "Profile priority config",
"name": "Profile priority config",
"prioritizedSourceUrls": [
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr2')",
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='4ce763dd-9214-4eff-af7c-da491cc3782d')"
]
}