创建 identityUserFlowAttribute

命名空间:microsoft.graph

创建新的 identityUserFlowAttribute 对象。

Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) IdentityUserFlow.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 IdentityUserFlow.ReadWrite.All

工作或学校帐户需要属于以下角色之一:

  • 全局管理员
  • 外部标识用户Flow属性管理员

HTTP 请求

POST /identity/userFlowAttributes

请求标头

名称 说明
Authorization Bearer {token}。必需。
Content-Type application/json. Required.

请求正文

在请求正文中,提供 identityUserFlowAttribute的 JSON 表示形式。

属性 类型 说明
id String 用户流属性的标识符。 这是一个自动创建的只读属性。
displayName String 用户流属性的显示名称。
说明 String 用户流属性的说明。 注册时,它向用户显示。
userFlowAttributeType String 用户流属性的类型。 这是一个自动设置的只读属性。 此属性的值将是 builtIncustom,具体取决于属性的类型。
DataType String 用户流属性的数据类型。 一旦创建自定义用户流属性,就无法对其进行修改。 dataType 支持的值有:
  • string
  • boolean
  • int64

响应

如果成功,此方法在响应 201 Created 正文中返回 响应代码和 identityUserFlowAttribute 对象。 如果失败,将返回 4xx 错误并显示具体详细信息。

示例

请求

下面展示了示例请求。

POST https://graph.microsoft.com/v1.0/identity/userFlowAttributes
Content-type: application/json

{
  "displayName": "Hobby",
  "description": "Your hobby",
  "dataType": "string",
}

响应

下面展示了示例响应。

注意: 为了提高可读性,可能缩短了此处显示的响应对象。

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"
}