名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
新しい profileSource オブジェクトを作成します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
PeopleSettings.ReadWrite.All |
注意事項なし。 |
重要
この操作に委任されたアクセス許可を使用するには、サインインしているユーザーにPeople管理者ロールが必要です。
HTTP 要求
POST /admin/people/profileSources
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. Required. |
手記: ペイロードの形式が正しくないエンコードの問題を回避するには、 Content-Type: application/json; charset=utf-8を使用します。
要求本文
要求本文で、 profileSource オブジェクトの JSON 表現を指定します。
profileSource を作成するときに、次のプロパティを指定できます。
| プロパティ |
型 |
説明 |
| displayName |
文字列 |
プロファイル ソース名についてユーザーに通知することを目的としたプロファイル ソースの名前。 |
| kind |
文字列 |
プロファイル ソースの種類。 |
| ローカライズ |
profileSourceLocalization コレクション |
管理者によって指定された別のローカライズされたラベル。 |
| sourceId |
文字列 |
代替キーとして使用されるプロファイル ソース識別子。 |
| webUrl |
String |
プロファイル データのページ ビューにユーザーを誘導するプロファイル ソースの Web URL。 |
応答
成功した場合、このメソッドは応答コード 201 Created と、応答本文に profileSource オブジェクトを返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/admin/people/profileSources
Content-Type: application/json
{
"sourceId": "bamboohr1",
"displayName": "HR Platform",
"kind": "BambooHR",
"webUrl": "https://bamboohr.contoso.com/login",
"localizations": [
{
"displayName": "HR-Plattform",
"webUrl": "http://bamboohr.contoso.com/de/login",
"languageTag": "de"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new ProfileSource
{
SourceId = "bamboohr1",
DisplayName = "HR Platform",
Kind = "BambooHR",
WebUrl = "https://bamboohr.contoso.com/login",
Localizations = new List<ProfileSourceLocalization>
{
new ProfileSourceLocalization
{
DisplayName = "HR-Plattform",
WebUrl = "http://bamboohr.contoso.com/de/login",
LanguageTag = "de",
},
},
};
// 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.ProfileSources.PostAsync(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.NewProfileSource()
sourceId := "bamboohr1"
requestBody.SetSourceId(&sourceId)
displayName := "HR Platform"
requestBody.SetDisplayName(&displayName)
kind := "BambooHR"
requestBody.SetKind(&kind)
webUrl := "https://bamboohr.contoso.com/login"
requestBody.SetWebUrl(&webUrl)
profileSourceLocalization := graphmodels.NewProfileSourceLocalization()
displayName := "HR-Plattform"
profileSourceLocalization.SetDisplayName(&displayName)
webUrl := "http://bamboohr.contoso.com/de/login"
profileSourceLocalization.SetWebUrl(&webUrl)
languageTag := "de"
profileSourceLocalization.SetLanguageTag(&languageTag)
localizations := []graphmodels.ProfileSourceLocalizationable {
profileSourceLocalization,
}
requestBody.SetLocalizations(localizations)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
profileSources, err := graphClient.Admin().People().ProfileSources().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ProfileSource profileSource = new ProfileSource();
profileSource.setSourceId("bamboohr1");
profileSource.setDisplayName("HR Platform");
profileSource.setKind("BambooHR");
profileSource.setWebUrl("https://bamboohr.contoso.com/login");
LinkedList<ProfileSourceLocalization> localizations = new LinkedList<ProfileSourceLocalization>();
ProfileSourceLocalization profileSourceLocalization = new ProfileSourceLocalization();
profileSourceLocalization.setDisplayName("HR-Plattform");
profileSourceLocalization.setWebUrl("http://bamboohr.contoso.com/de/login");
profileSourceLocalization.setLanguageTag("de");
localizations.add(profileSourceLocalization);
profileSource.setLocalizations(localizations);
ProfileSource result = graphClient.admin().people().profileSources().post(profileSource);
const options = {
authProvider,
};
const client = Client.init(options);
const profileSource = {
sourceId: 'bamboohr1',
displayName: 'HR Platform',
kind: 'BambooHR',
webUrl: 'https://bamboohr.contoso.com/login',
localizations: [
{
displayName: 'HR-Plattform',
webUrl: 'http://bamboohr.contoso.com/de/login',
languageTag: 'de'
}
]
};
await client.api('/admin/people/profileSources')
.version('beta')
.post(profileSource);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ProfileSource;
use Microsoft\Graph\Beta\Generated\Models\ProfileSourceLocalization;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ProfileSource();
$requestBody->setSourceId('bamboohr1');
$requestBody->setDisplayName('HR Platform');
$requestBody->setKind('BambooHR');
$requestBody->setWebUrl('https://bamboohr.contoso.com/login');
$localizationsProfileSourceLocalization1 = new ProfileSourceLocalization();
$localizationsProfileSourceLocalization1->setDisplayName('HR-Plattform');
$localizationsProfileSourceLocalization1->setWebUrl('http://bamboohr.contoso.com/de/login');
$localizationsProfileSourceLocalization1->setLanguageTag('de');
$localizationsArray []= $localizationsProfileSourceLocalization1;
$requestBody->setLocalizations($localizationsArray);
$result = $graphServiceClient->admin()->people()->profileSources()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
$params = @{
sourceId = "bamboohr1"
displayName = "HR Platform"
kind = "BambooHR"
webUrl = "https://bamboohr.contoso.com/login"
localizations = @(
@{
displayName = "HR-Plattform"
webUrl = "http://bamboohr.contoso.com/de/login"
languageTag = "de"
}
)
}
New-MgBetaAdminPeopleProfileSource -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.profile_source import ProfileSource
from msgraph_beta.generated.models.profile_source_localization import ProfileSourceLocalization
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ProfileSource(
source_id = "bamboohr1",
display_name = "HR Platform",
kind = "BambooHR",
web_url = "https://bamboohr.contoso.com/login",
localizations = [
ProfileSourceLocalization(
display_name = "HR-Plattform",
web_url = "http://bamboohr.contoso.com/de/login",
language_tag = "de",
),
],
)
result = await graph_client.admin.people.profile_sources.post(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profileSource",
"id": "27f1af7b-b166-4f5b-b994-ae135a581547",
"sourceId": "bamboohr1",
"displayName": "HR Platform",
"kind": "BambooHR",
"webUrl": "https://bamboohr.contoso.com/login",
"localizations": [
{
"displayName": "HR-Plattform",
"webUrl": "http://bamboohr.contoso.com/de/login",
"languageTag": "de"
}
]
}