更新 identityUserFlowAttribute
本文内容
命名空间:microsoft.graph
更新 identityUserFlowAttribute 对象 的属性。 只能更新自定义用户流属性。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
IdentityUserFlow.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
IdentityUserFlow.ReadWrite.All
工作或学校帐户需要属于以下角色之一:
HTTP 请求
PATCH /identity/userFlowAttributes/{id}
名称
说明
Authorization
Bearer {token}。必需。
Content-Type
application/json. Required.
请求正文
在请求正文中,为 JSON 对象提供一个或多个需要为 identityUserFlowAttribute 对象更新的属性。
注意: 只能 更新 description 属性。
属性
类型
说明
说明
String
用户流属性的说明。 它在注册时显示给用户。
响应
如果成功,此方法返回 204 No Content 响应代码。 如果失败,将返回 4xx 错误并显示具体详细信息。
示例
请求
下面展示了示例请求。
PATCH https://graph.microsoft.com/v1.0/identity/userFlowAttributes/extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby
Content-type: application/json
{
"description": "Your new hobby"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var identityUserFlowAttribute = new IdentityUserFlowAttribute
{
Description = "Your new hobby"
};
await graphClient.Identity.UserFlowAttributes["{identityUserFlowAttribute-id}"]
.Request()
.UpdateAsync(identityUserFlowAttribute);
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
const identityUserFlowAttribute = {
description: 'Your new hobby'
};
await client.api('/identity/userFlowAttributes/extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby')
.update(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/extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphIdentityUserFlowAttribute *identityUserFlowAttribute = [[MSGraphIdentityUserFlowAttribute alloc] init];
[identityUserFlowAttribute setDescription:@"Your new hobby"];
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.description = "Your new hobby";
graphClient.identity().userFlowAttributes("extension_d09380e2b4c642b9a203fb816a04a7ad_Hobby")
.buildRequest()
.patch(identityUserFlowAttribute);
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewIdentityUserFlowAttribute()
description := "Your new hobby"
requestBody.SetDescription(&description)
identityUserFlowAttributeId := "identityUserFlowAttribute-id"
graphClient.Identity().UserFlowAttributesById(&identityUserFlowAttributeId).Patch(requestBody)
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
下面展示了示例响应。
HTTP/1.1 204 No Content