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

创建用户

功能介绍

使用SCIM协议,同步用户到IAM身份中心。

URI

POST /{tenant_id}/scim/v2/Users

表1 路径参数

参数

是否必选

参数类型

描述

tenant_id

String

租户的全局唯一标识符(ID)。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

Authorization

String

承载令牌。

表3 请求Body参数

参数

是否必选

参数类型

描述

externalId

String

外部标识符。

userName

String

用户名,用于标识用户的唯一字符串。

name

Object

包含用户姓名信息的对象。

displayName

String

包含用户显示名称的字符串。

nickName

String

包含用户昵称的字符串。

profileUrl

String

包含可能与用户关联的URL的字符串。

emails

Array of objects

包含用户的电子邮箱信息的对象列表。

addresses

Array of objects

包含用户地址信息的对象列表。

phoneNumbers

Array of objects

包含用户电话号码信息的对象列表。

userType

String

指示用户类型的字符串。

title

String

包含用户头衔的字符串。

preferredLanguage

String

包含用户首选语言的字符串。

locale

String

包含用户地理区域或位置的字符串。

timezone

String

包含用户时区的字符串。

active

Boolean

表示用户是否启用。

schemas

Array of strings

概要。

urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

Object

包含用户工作相关信息的对象。

表4 name

参数

是否必选

参数类型

描述

formatted

String

包含要显示的名称的格式化版本的字符串。

familyName

String

用户的姓氏。

givenName

String

用户的名字。

middleName

String

用户的中间名。

honorificPrefix

String

用户的尊称前缀。

honorificSuffix

String

用户的尊称后缀。

表5 emails

参数

是否必选

参数类型

描述

value

String

包含电子邮箱地址的字符串。

type

String

表示电子邮箱类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主电子邮箱。

表6 addresses

参数

是否必选

参数类型

描述

formatted

String

包含要显示的地址的格式化版本的字符串。

streetAddress

String

街道。

locality

String

地址位置。

region

String

区域。

postalCode

String

邮政编码。

country

String

国家或地区。

type

String

表示地址类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主地址。

表7 phoneNumbers

参数

是否必选

参数类型

描述

value

String

包含电话号码的字符串。

type

String

表示电话号码类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主电话号码。

表8 urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

参数

是否必选

参数类型

描述

costCenter

String

成本中心。

最小长度:1

最大长度:1024

department

String

部门。

最小长度:1

最大长度:1024

division

String

分部。

最小长度:1

最大长度:1024

employeeNumber

String

员工编号。

最小长度:1

最大长度:1024

manager

Object

经理。

organization

String

组织。

最小长度:1

最大长度:1024

表9 manager

参数

是否必选

参数类型

描述

value

String

经理。

最小长度:1

最大长度:1024

响应参数

状态码: 201

表10 响应Body参数

参数

参数类型

描述

id

String

用户的全局唯一标识符(ID)。

externalId

String

外部标识符。

meta

Object

元数据。

schemas

Array of strings

概要。

userName

String

用户名,用于标识用户的唯一字符串。

name

Object

包含用户姓名信息的对象。

displayName

String

包含用户显示名称的字符串。

nickName

String

包含用户昵称的字符串。

title

String

包含用户头衔的字符串。

userType

String

指示用户类型的字符串。

preferredLanguage

String

包含用户首选语言的字符串。

locale

String

包含用户地理区域或位置的字符串。

timezone

String

包含用户时区的字符串。

active

Boolean

表示用户是否启用。

emails

Array of objects

包含用户的电子邮箱信息的对象列表。

addresses

Array of objects

包含用户地址信息的对象列表。

phoneNumbers

Array of objects

包含用户电话号码信息的对象列表。

urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

Object

包含用户工作相关信息的对象。

表11 meta

参数

参数类型

描述

resourceType

String

资源类型。

created

String

资源创建时间。

lastModified

String

资源最后更新时间。

表12 name

参数

参数类型

描述

formatted

String

包含要显示的名称的格式化版本的字符串。

familyName

String

用户的姓氏。

givenName

String

用户的名字。

middleName

String

用户的中间名。

honorificPrefix

String

用户的尊称前缀。

honorificSuffix

String

用户的尊称后缀。

表13 emails

参数

参数类型

描述

value

String

包含电子邮箱地址的字符串。

type

String

表示电子邮箱类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主电子邮箱。

表14 addresses

参数

参数类型

描述

formatted

String

包含要显示的地址的格式化版本的字符串。

streetAddress

String

街道。

locality

String

地址位置。

region

String

区域。

postalCode

String

邮政编码。

country

String

国家或地区。

type

String

表示地址类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主地址。

表15 phoneNumbers

参数

参数类型

描述

value

String

包含电话号码的字符串。

type

String

表示电话号码类型的字符串。

primary

Boolean

一个布尔值,表示这是否为用户的主电话号码。

表16 urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

参数

参数类型

描述

costCenter

String

成本中心。

最小长度:1

最大长度:1024

department

String

部门。

最小长度:1

最大长度:1024

division

String

分部。

最小长度:1

最大长度:1024

employeeNumber

String

员工编号。

最小长度:1

最大长度:1024

manager

Object

经理。

organization

String

组织。

最小长度:1

最大长度:1024

表17 manager

参数

参数类型

描述

value

String

经理。

最小长度:1

最大长度:1024

状态码: 400

表18 响应Body参数

参数

参数类型

描述

schema

String

概要。

schemas

Array of strings

概要列表。

detail

String

异常详情。

status

Integer

状态码。

timeStamp

String

时间戳。

状态码: 403

表19 响应Body参数

参数

参数类型

描述

schema

String

概要。

schemas

Array of strings

概要列表。

detail

String

异常详情。

status

Integer

状态码。

timeStamp

String

时间戳。

状态码: 404

表20 响应Body参数

参数

参数类型

描述

schema

String

概要。

schemas

Array of strings

概要列表。

detail

String

异常详情。

status

Integer

状态码。

timeStamp

String

时间戳。

状态码: 409

表21 响应Body参数

参数

参数类型

描述

schema

String

概要。

schemas

Array of strings

概要列表。

detail

String

异常详情。

status

Integer

状态码。

timeStamp

String

时间戳。

状态码: 500

表22 响应Body参数

参数

参数类型

描述

schema

String

概要。

schemas

Array of strings

概要列表。

detail

String

异常详情。

status

Integer

状态码。

timeStamp

String

时间戳。

请求示例

创建用户

POST https://{hostname}/{tenant_id}/scim/v2/Users

{
  "externalId" : "123456",
  "userName" : "xxx",
  "name" : {
    "formatted" : "xxx",
    "familyName" : "xxx",
    "givenName" : "xxx",
    "middleName" : "xxx",
    "honorificPrefix" : "xxx",
    "honorificSuffix" : "xxx"
  },
  "displayName" : "xxx",
  "nickName" : "xxx",
  "profileUrl" : "xxx",
  "emails" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "addresses" : [ {
    "formatted" : "xxx",
    "streetAddress" : "xxx",
    "locality" : "xxx",
    "region" : "xxx",
    "postalCode" : "123456",
    "country" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "phoneNumbers" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "userType" : "xxx",
  "title" : "xxx",
  "preferredLanguage" : "zh-CN",
  "locale" : "zh-CN",
  "timezone" : "xxx",
  "active" : true,
  "schemas" : [ "urn:ietf:params:scim:schemas:core:2.0:User" ]
}

响应示例

状态码: 201

Successful

{
  "id" : "ac6aa714-daa7-1aaa-aaa2-6715aaaa4dd9",
  "externalId" : "123456",
  "meta" : {
    "resourceType" : "User",
    "created" : "2023-04-08T14:53:43Z",
    "lastModified" : "2023-04-08T14:53:43Z"
  },
  "schemas" : [ "urn:ietf:params:scim:schemas:core:2.0:User" ],
  "userName" : "xxx",
  "name" : {
    "formatted" : "xxx",
    "familyName" : "xxx",
    "givenName" : "xxx",
    "middleName" : "xxx",
    "honorificPrefix" : "xxx",
    "honorificSuffix" : "xxx"
  },
  "displayName" : "xxx",
  "nickName" : "xxx",
  "title" : "xxx",
  "userType" : "xxx",
  "preferredLanguage" : "zh-CN",
  "locale" : "zh-CN",
  "timezone" : "xxx",
  "active" : true,
  "emails" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "addresses" : [ {
    "formatted" : "xxx",
    "streetAddress" : "xxx",
    "locality" : "xxx",
    "region" : "xxx",
    "postalCode" : "123456",
    "country" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "phoneNumbers" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ]
}

状态码

请参见状态码

错误码

请参见错误码

分享:

    相关文档

    相关产品