IdentityUserFlowAttribute の作成
-
[アーティクル]
-
-
名前空間: microsoft.graph
新しい identityUserFlowAttribute オブジェクトを作成 します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
IdentityUserFlow.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
IdentityUserFlow.ReadWrite.All |
仕事または学校のアカウントは、次のいずれかの役割に属している必要があります。
- 全体管理者
- 外部 ID ユーザー Flow属性管理者
HTTP 要求
POST /identity/userFlowAttributes
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-Type |
application/json. Required. |
要求本文
要求本文で 、identityUserFlowAttributeの JSON 表記を指定します。
| プロパティ |
型 |
説明 |
| id |
String |
ユーザー フロー属性の ID。 これは読み取り専用属性であり、自動的に作成されます。 |
| displayName |
String |
ユーザー フロー属性の表示名。 |
| 説明 |
String |
ユーザー フロー属性の説明。 サインアップ時にユーザーに表示されます。 |
| userFlowAttributeType |
String |
ユーザー フロー属性の種類。 これは読み取り専用属性であり、自動的に設定されます。 属性の種類に応じて、このプロパティの値は builtIn または custom になります。 |
| 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",
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var identityUserFlowAttribute = new IdentityUserFlowAttribute
{
DisplayName = "Hobby",
Description = "Your hobby",
DataType = IdentityUserFlowAttributeDataType.String
};
await graphClient.Identity.UserFlowAttributes
.Request()
.AddAsync(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 のドキュメントを参照してください。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identity/userFlowAttributes"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphIdentityUserFlowAttribute *identityUserFlowAttribute = [[MSGraphIdentityUserFlowAttribute alloc] init];
[identityUserFlowAttribute setDisplayName:@"Hobby"];
[identityUserFlowAttribute setDescription:@"Your hobby"];
[identityUserFlowAttribute setDataType: [MSGraphIdentityUserFlowAttributeDataType string]];
NSError *error;
NSData *identityUserFlowAttributeData = [identityUserFlowAttribute getSerializedDataWithError:&error];
[urlRequest setHTTPBody:identityUserFlowAttributeData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
IdentityUserFlowAttribute identityUserFlowAttribute = new IdentityUserFlowAttribute();
identityUserFlowAttribute.displayName = "Hobby";
identityUserFlowAttribute.description = "Your hobby";
identityUserFlowAttribute.dataType = IdentityUserFlowAttributeDataType.STRING;
graphClient.identity().userFlowAttributes()
.buildRequest()
.post(identityUserFlowAttribute);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewIdentityUserFlowAttribute()
displayName := "Hobby"
requestBody.SetDisplayName(&displayName)
description := "Your hobby"
requestBody.SetDescription(&description)
dataType := "string"
requestBody.SetDataType(&dataType)
result, err := graphClient.Identity().UserFlowAttributes().Post(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Location: https://graph.microsoft.com/v1.0/identity/userFlowAttributes/extension_7a95ecd9489b4fb9a45722b913c4703b_Hobby
Content-type: application/json
{
"id": "extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby",
"displayName": "Hobby",
"description": "Your hobby",
"userFlowAttributeType": "custom",
"dataType": "string"
}