O2OA教程-安装管理及配置-数据同步接口

236 阅读9分钟

用户信息包括3个部分:基本信息、用户属性和所在部门。新增用户(add)和修改用户(update)时,需列式该用户下的全量属性和所在部门。接口根据报文的用户所在部门对用户的身份进行增删改。 组织信息包括3个部分:基本信息、组织属性和组织职务。新增组织(add)和修改组织(update)时,需列式该组织下的全量组织属性和组织职务。接口同时根据报文对组织属性和组织职务进行增删改
参考:www.o2oa.net/x_desktop/f…

一、人员数据接口

服务地址 http://{centerserver}:20030/x_program_center/jaxrs/invoke/personSync/execute
调用方式 HTTP
调用方法 POST
请求报文Content-Type application/json; charset=utf-8
响应报文Content-Type application/json; charset=utf-8

本服务对应用户的增删改查操作,通过传请求报文的action参数进行对应的操作:

参数 执行操作
add 新增用户
update 修改用户
updatepwd 修改密码
updateSuperior 修改用户的汇报对象
delete 删除用户

如:删除用户的请求报文为

{
"action": "delete", //删除用户
"flag" : "" //用户标志
}

1、新增用户

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

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

响应报文

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

2、修改用户

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

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

响应报文

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

3、删除用户

请求报文

{
     action : "delete",
     flag: "",  //用户标志位
}
说明:flag用来查找用户
可以为distinguishedName : "",  //识别名,,@P结尾.
unique : "",              //唯一标识,
employee: "",           //工号,.
mobile: "",             //,手机号.
Id : ""                 //个人数据库主键

响应报文

{
  "data": {
    "value": {
    "result" : "",               //响应成功为 success, 失败为error
        "description": ""          //响应结果描述
     }
  }
}

4、修改用户密码

请求报文

{
action : "updatepwd",
flag: "", //用户标志位
password: "" //新密码
}

说明:flag用来查找用户
可以为distinguishedName : "", //识别名,,@P结尾.
unique : "", //唯一标识,
employee: "", //工号,.
mobile: "", //,手机号.
Id : "" //个人数据库主键
响应报文

{
"data": {
"value": {
"result" : "", //响应成功为 success, 失败为error
"description": "" //响应结果描述
}
}
}

5、修改汇报对象

请求报文

{
action : "updateSuperior",
flag: "", //用户标志位
superior: "" //用户汇报对象
}

说明:flag用来查找用户
可以为distinguishedName : "", //识别名,,@P结尾.
unique : "", //唯一标识,
employee: "", //工号,.
mobile: "", //,手机号.
Id : "" //个人数据库主键
响应报文

{
"data": {
"value": {
"result" : "", //响应成功为 success, 失败为error
"description": "" //响应结果描述
}
}
}