# 新增用户

用户信息包括3个部分：基本信息、用户属性和所在部门。新增用户，需列式该用户下的全量属性和所在部门。接口根据报文的用户所在部门对用户的身份进行新增。

**请求报文**

| <p>{</p><p>    action : “add”,</p><p>genderType : "m",              //性别.男:m,女:f,未知:d</p><p>    signature : "",                   //个性签名</p><p>    description :"",          // 描述.</p><p>    name: "",                           //名称,可重名.</p><p>    employee: "",                     //工号,必填,不可重复.</p><p>    unique: "",                  //唯一标识,不可重复,为空则使用自动填充值</p><p>    distinguishedName: "", //识别名,系统自动填充,@P结尾.</p><p>    orderNumber: "",               //排序号,升序排列,为空在最后</p><p>    controllerList: "",        //个人管理者.默认为创建者。</p><p>    superior: "",               //汇报对象.</p><p>    mail: "",                            //邮件地址.</p><p>    weixin: "",                  //微信号.</p><p>    qq: "",                                //QQ号.</p><p>    mobile: "",                  //必填,手机号.</p><p>    officePhone: "",          //办公电话.</p><p>    boardDate: "",                   //入职时间.</p><p>    birthday: "",                //生日.</p><p>    age: "",                      //年龄</p><p>    dingdingId: "",            //钉钉人员ID.</p><p>    dingdingHash: ""               //钉钉人员哈希特征.</p><p>       attributeList : \[                    //用户的其他属性，需全量列式</p><p>              {</p><p>                     name : "",             //属性名称,</p><p>                     value : "",             //属性值，允许字符串或者数组</p><p>                     description : "" //属性描述</p><p>                     orderNumber: "" //排序号,升序排列,为空在最后</p><p>              }</p><p>              ...</p><p>       ],</p><p>       unitList : \[                          //用户所在部门，需全量列式</p><p>              {</p><p>                     flag: "",                //组织标志位，可以为组织唯一编码unique/组织的distinguishedName/组织id</p><p>                     orderNumber: "",  //在组织里的排序号,升序排列,为空在最后</p><p>                     description: "",     //描述</p><p>                     duty : "",               //用户的职务</p><p>                     position : ""          //用户的岗位</p><p>              }</p><p>              ...</p><p>       ]</p><p>}</p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

| 属性                  | 上级            | 类型           | 单值/多值  | 必填   | 说明                                                                                   | 样例                                                               |
| ------------------- | ------------- | ------------ | ------ | ---- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
| action              |               | string       | single | true | 操作                                                                                   | add                                                              |
| genderType          |               | string       | single | true | 性别.男:m,女:f,未知:d                                                                      | m                                                                |
| signature           |               | string       | single |      | 个性签名.                                                                                | 香港移动                                                             |
| description         |               | string       | single |      | 描述.                                                                                  | 香港移动                                                             |
| name                |               | string       | single | true | 名称,可重名.                                                                              | 张三                                                               |
| employee            |               | string       | single | true | 工号,必填,不可重复.                                                                          | P0780                                                            |
| unique              |               | string       | single |      | 唯一标识,不可重复,为空则使用自动填充值                                                                 | fb3ea7de-d54f-4679-8e9a-35cb1e6b3d01                             |
| distinguishedName   |               | string       | single |      | 识别名,自动填充,@P结尾.                                                                       | 张三@fb3ea7de-d54f-4679-8e9a-35cb1e6b3d01\@P                       |
| orderNumber         |               | number       | single |      | 排序号,升序排列,为空在最后                                                                       | 1                                                                |
| controllerarray     |               | array        | multi  |      | 个人管理者.默认为创建者。                                                                        | 83de86fc-60bc-4b4c-955c-1085915865a4                             |
| superior            |               | string       | single |      | <p>汇报对象.</p><p>可以为汇报对象的distinguishedName 、unique 、employee、mobile。如果未找到汇报对象，不设置。</p> | P0180                                                            |
| mail                |               | string       | single |      | 邮件地址，不可重复.                                                                           | <1234567@qq.com>                                                 |
| weixin              |               | string       | single |      | 微信号.                                                                                 |                                                                  |
| qq                  |               | string       | single |      | QQ号.                                                                                 | 1234567                                                          |
| mobile              |               | string       | single | true | 必填,手机号,不可重复.                                                                         | 13800000000                                                      |
| officePhone         |               | string       | single |      | 办公电话.                                                                                | 0571-88888888                                                    |
| boarddate           |               | date-string  | single |      | 入职时间.                                                                                | 2015-02-02                                                       |
| birthday            |               | date-string  | single |      | 生日.                                                                                  | 1995-10-12                                                       |
| age                 |               | number       | single |      | 年龄                                                                                   | 20                                                               |
| dingdingId          |               | string       | single |      | 钉钉人员ID.                                                                              |                                                                  |
| dingdingHash        |               | string       | single |      | 钉钉人员哈希特征.                                                                            |                                                                  |
| zhengwuDingdingId   |               | string       | single |      | 政务钉钉人员ID.                                                                            | 1000833324                                                       |
| zhengwuDingdingHash |               | string       | single |      | 政务钉钉人员哈希特征.                                                                          | b388708eb84d6ae6328e03526a069ec864416a3b916ce22b8fb8bbfa3d84eb6b |
| qiyeweixinId        |               | string       | single |      | 企业微信人员ID.                                                                            |                                                                  |
| qiyeweixinHash      |               | string       | single |      | 企业微信人员哈希特征.                                                                          |                                                                  |
| attributeList       |               | array        | multi  |      | 其他人员属性列表                                                                             |                                                                  |
| name                | attributeList | string       | single |      | 属性名称                                                                                 | 级别                                                               |
| description         | attributeList | string       | single |      | 属性描述                                                                                 | 级别描述                                                             |
| value               | attributeList | string/array | multi  |      | 属性值                                                                                  | 1 / \[ "1" ]                                                     |
| orderNumber         | attributeList | string       | single |      | 排序号,升序排列,为空在最后                                                                       | 18315158                                                         |
| unitList            |               | array        | multi  |      | 所在组织列表                                                                               |                                                                  |
| flag                | unitList      | string       | single |      | 组织标志位，可以为组织唯一编码unique/组织的distinguishedName/组织id                                      | "companyLeader/"公司管理层@9b45cb75-52f8-4e73-8470-4cdc78230b7d\@U",  |
| orderNumber         | unitList      | string       | single |      | 用户在组织里的排序号升序排列,为空在最后                                                                 | 123                                                              |
| description         | unitList      | string       | single |      | 描述                                                                                   | 公司管理层                                                            |
| duty                | unitList      | string       | single |      | 用户在该组织的职务                                                                            | 正职领导                                                             |
| position            | unitList      | string       | single |      | 用户在该组织的岗位                                                                            | 管理岗                                                              |

**响应报文**

| <p>{</p><p>  "data": {</p><p>"value": {</p><p>    "id" : "",  //如果成功，用户64位id</p><p>"result" : "",               //响应成功为 success, 失败为error</p><p>        "description": ""          //响应结果描述</p><p>     }</p><p>  }</p><p>}</p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://o2oa.gitbook.io/course/ping-tai-shi-shi/zu-zhi-guan-li/shu-ju-tong-bu-jie-kou/ren-yuan-shu-ju-jie-kou/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
