更新时间:2024-04-29 GMT+08:00
分享

更新用户

功能介绍

根据用户ID,更新对应IAM身份中心用户的属性。

URI

PUT /v1/identity-stores/{identity_store_id}/users/{user_id}

表1 路径参数

参数

是否必选

参数类型

描述

identity_store_id

String

身份源的全局唯一标识符(ID)。

最小长度:12

最大长度:12

user_id

String

身份源中IAM身份中心用户的全局唯一标识符(ID)。

最小长度:1

最大长度:64

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Security-Token

String

如果正在使用临时安全凭据,则此header是必需的,该值是临时安全凭据的安全令牌(会话令牌)。

最大长度:2048

表3 请求Body参数

参数

是否必选

参数类型

描述

operations

Array of objects

更新的用户属性列表。

数组长度:1-100

表4 operations

参数

是否必选

参数类型

描述

attribute_path

String

要更新的属性的字符串表示。

最小长度:1

最大长度:255

attribute_value

String

要更新的属性值。当属性为对象类型时,此处填写对象的JSON字符串。为null时表示删除对应属性。

响应参数

状态码: 400

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息。

request_id

String

请求ID。

encoded_authorization_message

String

鉴权信息。

状态码: 403

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息。

request_id

String

请求ID。

encoded_authorization_message

String

鉴权信息。

状态码: 404

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息。

request_id

String

请求ID。

encoded_authorization_message

String

鉴权信息。

请求示例

根据用户ID,更新对应IAM身份中心用户的属性。

PUT https://{hostname}/v1/identity-stores/{identity_store_id}/users/{user_id}

{
  "operations" : [ {
    "attribute_path" : "emails",
    "attribute_value" : "[{\"primary\":true,\"type\":\"Work\",\"value\":\"new-email@example.com\"}]"
  }, {
    "attribute_path" : "name",
    "attribute_value" : "{\"family_name\":\"姓氏\",\"given_name\":\"名字-new\"}"
  }, {
    "attribute_path" : "display_name",
    "attribute_value" : "用户显示名-new"
  } ]
}

响应示例

状态码

请参见状态码

错误码

请参见错误码

分享:

    相关文档

    相关产品