identityUserFlowAttribute を作成する
[アーティクル]
01/30/2024
7 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
新しいカスタム IDUserFlowAttribute オブジェクトを 作成します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
❌
❌
✅
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ 、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類 」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください 。
アクセス許可の種類
最小特権アクセス許可
特権の高いアクセス許可
委任 (職場または学校のアカウント)
IdentityUserFlow.ReadWrite.All
注意事項なし。
委任 (個人用 Microsoft アカウント)
サポートされていません。
サポートされていません。
アプリケーション
IdentityUserFlow.ReadWrite.All
注意事項なし。
委任されたシナリオの場合、管理者には少なくとも外部 ID ユーザー フロー属性管理者 Microsoft Entraロール が必要です。
HTTP 要求
POST /identity/userFlowAttributes
名前
説明
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
Content-Type
application/json. 必須です。
要求本文
要求本文で、 identityUserFlowAttribute の JSON 表現を指定します。
プロパティ
型
説明
id
String
ユーザー フロー属性の ID。 これは読み取り専用属性であり、自動的に作成されます。
displayName
String
ユーザー フロー属性の表示名。
説明
String
ユーザー フロー属性の説明。 サインアップ時にユーザーに表示されます。
userFlowAttributeType
String
ユーザー フロー属性の種類。 これは読み取り専用属性であり、自動的に設定されます。 属性の種類に応じて、このプロパティの値は または custom
ですbuiltIn
。
dataType
String
ユーザー フロー属性のデータ型。 これは、カスタム ユーザー フロー属性が作成された後は変更できません。 dataType でサポートされる値は次のとおりです。
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文の identityUserFlowAttribute オブジェクトを返します。 失敗した場合は、特定の 4xx
詳細を含むエラーが返されます。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/identity/userFlowAttributes
Content-type: application/json
{
"displayName": "Hobby",
"description": "Your hobby",
"dataType": "string"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IdentityUserFlowAttribute
{
DisplayName = "Hobby",
Description = "Your hobby",
DataType = IdentityUserFlowAttributeDataType.String,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.UserFlowAttributes.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc identity user-flow-attributes create --body '{\
"displayName": "Hobby",\
"description": "Your hobby",\
"dataType": "string"\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewIdentityUserFlowAttribute()
displayName := "Hobby"
requestBody.SetDisplayName(&displayName)
description := "Your hobby"
requestBody.SetDescription(&description)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
requestBody.SetDataType(&dataType)
userFlowAttributes, err := graphClient.Identity().UserFlowAttributes().Post(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);
IdentityUserFlowAttribute identityUserFlowAttribute = new IdentityUserFlowAttribute();
identityUserFlowAttribute.setDisplayName("Hobby");
identityUserFlowAttribute.setDescription("Your hobby");
identityUserFlowAttribute.setDataType(IdentityUserFlowAttributeDataType.String);
IdentityUserFlowAttribute result = graphClient.identity().userFlowAttributes().post(identityUserFlowAttribute);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const identityUserFlowAttribute = {
displayName: 'Hobby',
description: 'Your hobby',
dataType: 'string'
};
await client.api('/identity/userFlowAttributes')
.post(identityUserFlowAttribute);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttribute;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IdentityUserFlowAttribute();
$requestBody->setDisplayName('Hobby');
$requestBody->setDescription('Your hobby');
$requestBody->setDataType(new IdentityUserFlowAttributeDataType('string'));
$result = $graphServiceClient->identity()->userFlowAttributes()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
displayName = "Hobby"
description = "Your hobby"
dataType = "string"
}
New-MgIdentityUserFlowAttribute -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.identity_user_flow_attribute import IdentityUserFlowAttribute
graph_client = GraphServiceClient(credentials, scopes)
request_body = IdentityUserFlowAttribute(
display_name = "Hobby",
description = "Your hobby",
data_type = IdentityUserFlowAttributeDataType.String,
)
result = await graph_client.identity.user_flow_attributes.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Location: "/identity/userFlowAttributes('extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby')"
Content-type: application/json
{
"id": "extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby",
"displayName": "Hobby",
"description": "Your hobby",
"userFlowAttributeType": "custom",
"dataType": "string"
}