Namespace: microsoft.graph
Erstellen Sie ein neues profilePropertySetting-Objekt .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
PeopleSettings.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
PeopleSettings.ReadWrite.All |
Nicht verfügbar. |
Wichtig
Für delegierten Zugriff über Geschäfts-, Schul- oder Unikonten muss dem Administrator eine unterstützte Microsoft Entra Rolle zugewiesen werden.
People Administrator ist die Rolle mit den geringsten Berechtigungen, die für diesen Vorgang unterstützt wird.
HTTP-Anforderung
POST /admin/people/profilePropertySettings
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des profilePropertySetting-Objekts an.
Sie können die folgenden Eigenschaften angeben, wenn Sie ein profilePropertySetting-Element erstellen.
| Eigenschaft |
Typ |
Beschreibung |
| displayName |
Zeichenfolge |
Der Name der Einstellung auf Eigenschaftsebene. Optional. |
| name |
Zeichenfolge |
Anderer Name der Einstellung auf Eigenschaftsebene. Aus Gründen der Abwärtskompatibilität. Optional. |
| prioritizedSourceUrls |
String collection |
Eine Sammlung priorisierter Profilquell-URLs, sortiert nach Datenrangfolge innerhalb eines organization. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein profilePropertySetting-Objekt im Antworttext zurück.
Beispiele
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/v1.0/admin/people/profilePropertySettings
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profilePropertySetting",
"displayName": "Profile priority config",
"name": "Profile priority config",
"prioritizedSourceUrls": [
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')"
]
}
// 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",
DisplayName = "Profile priority config",
Name = "Profile priority config",
PrioritizedSourceUrls = new List<string>
{
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
},
};
// 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.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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()
displayName := "Profile priority config"
requestBody.SetDisplayName(&displayName)
name := "Profile priority config"
requestBody.SetName(&name)
prioritizedSourceUrls := []string {
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
}
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().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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");
profilePropertySetting.setDisplayName("Profile priority config");
profilePropertySetting.setName("Profile priority config");
LinkedList<String> prioritizedSourceUrls = new LinkedList<String>();
prioritizedSourceUrls.add("https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')");
profilePropertySetting.setPrioritizedSourceUrls(prioritizedSourceUrls);
ProfilePropertySetting result = graphClient.admin().people().profilePropertySettings().post(profilePropertySetting);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const profilePropertySetting = {
'@odata.type': '#microsoft.graph.profilePropertySetting',
displayName: 'Profile priority config',
name: 'Profile priority config',
prioritizedSourceUrls: [
'https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr1\')'
]
};
await client.api('/admin/people/profilePropertySettings')
.post(profilePropertySetting);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?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->setDisplayName('Profile priority config');
$requestBody->setName('Profile priority config');
$requestBody->setPrioritizedSourceUrls(['https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId=\'contosohr1\')', ]);
$result = $graphServiceClient->admin()->people()->profilePropertySettings()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# 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",
display_name = "Profile priority config",
name = "Profile priority config",
prioritized_source_urls = [
"https://graph.microsoft.com/v1.0/admin/people/profileSources(sourceId='contosohr1')",
],
)
result = await graph_client.admin.people.profile_property_settings.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
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='4ce763dd-9214-4eff-af7c-da491cc3782d')"
]
}