通讯录选人组件(/campus/department/select)

使用场景: 获取本单位(学校)或本单位以及下属单位、下属学校的通讯录树状结构

权限说明

权限项 说明 备注
应用是否需要申请白名单 需要
用户凭证 支持 普通用户票据或选人组件专用票据
机构凭证 不支持 -

请求方式: GET, POST (HTTPS

请求地址: https://test-oapi.epaas.qq.com/campus/department/select?access_token=ACCESS_TOKEN

请求示例:

{
  "id": 12345,
  "department_type_list":[7],
  "select_type": 0,
  "select_node_type": 1,
  "is_include_sub_org": true,
  "corpid":0,
  "need_users_total":false
}

参数说明:

参数 必须 说明
access_token 选人组件token,由 /open/get_app_token获得
department_type_list 部门类型列表,能够获取哪些类型的组织架构或人员;1 学生, 2 教职工, 4 校友, 5 退休老师, 6 临时架构组, 7 虚拟组, 8 课程班, 9 局内职工, 10 教学班 ,14 虚拟机构
select_node_type 选人组件节点类型。第一次不传,后续请求,每个节点会返回对应值,回填至入参
select_type 控制是否可勾选;0 架构和用户均可选,1 只用户可选,2 只架构可选
Id 组织架构id,第一次请求传0,后续请求传返回值中的id
key 组织架构或人员的名称或手机号,名称支持模糊检索,手机号精确匹配
select_tag_list (仅支持班级类型)允许可勾选哪些tag类型的部门,或其部门下的成员;1 学生, 2 学部, 3 学院, 4 年级, 5 班级, 6 系别, 7 专业, 8 学年, 9 学期, 10 校区
select_role_list (仅支持班级类型)表示要返回哪些角色的人员;11 学生,12 老师,13 家长
is_include_sub_org 是否展示下级单位或学校
is_show_root 是否展示机构根节点
is_get_all_student (仅支持老师角色,需要配置应用权限)是否提权拉取所有学生
search_type 搜索类型(0-姓名搜索,3-手机号或姓名搜索,默认为0)
hide_creator 是否隐藏创建者
corpid 指定下属机构id
need_users_total 是否需要返回组织架构下用户总数 默认:false

返回结果:

{
    "errmsg": "ok",
    "errcode": 0,
    "node_list": [
        {
            "id": 3029003,
            "name": "一班",
            "id_type": 2,
            "corpid": 890000,
            "select_node_type": 1,
            "parent_id": 3029002,
            "path": "2010级/一班",
            "id_path": [
                3029000,
                3029001,
                3029002,
                3029003
            ],
            "role_id": 0,
            "disabled": false,
            "is_parent": false,
            "child_id":0,
            "child_name":"",
            "child_relation":"",
            "department_type":0,
            "grade_name":"",
            "org_attribute_name":"",
            "has_sub_org":0,
            "users_total":0,
        }
    ]
}

返回值参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
node_list.id 节点Id
node_list.id_type 节点Id类型, 用户Id:1;组织架构Id:2
node_list.name 节点名
node_list.corpid 所属机构Id
node_list.select_node_type 节点类型。每个节点会返回对应值,直接回填至入参即可
node_list.parent_id 父节点Id
node_list.path 组织架构路径
node_list.id_path 组织架构路径Id
node_list.role_id 角色id, 参考角色类型
node_list.disabled 节点在通讯录中是否不可勾选,true为不可勾选
node_list.is_parent 当前节点是否为父节点,可向下展开
node_list.child_id 家长用户节点返回孩子ID
node_list.child_name 家长用户节点返回孩子姓名
node_list.child_relation 家长用户节点返回与孩子关系
node_list.department_type 部门类型(节点类型)0 学校, 1 学生, 2 教职工, 4 校友(毕业生), 5 退休老师, 6 临时组, 7 虚拟组, 8 课程班, 9 上级单位, 10 教学班, 11 上级单位根节点, 12 学校运营人员, 13 教育局运营人员,14 虚拟机构
node_list.grade_name 年级名称,展示在括号里
node_list.org_attribute_name 学段名称,展示在括号里
node_list.has_sub_org 是否有下属机构 0:无 1:有
node_list.users_total 组织下的用户数量

获取部门列表下的人员列表(/department/user/get)

使用场景: 获取部门列表下的人员列表

权限说明

权限项 说明 备注
应用是否需要申请白名单 不需要
用户凭证 支持
机构凭证 不支持 -

请求方式: POST (HTTPS

请求地址: https://test-oapi.epaas.qq.com/department/user/get?access_token=ACCESS_TOKEN

请求包体

{
    "role_ids": [11, 12],
    "org_department_info_list": [
        {
            "corpid": 10010,
            "department_ids": [3032953, 3024538]
        },
        {
            "corpid": 10011,
            "department_ids": [3032952]
        }
    ],
    "hide_creator":true,
    "need_depart":1
}

参数说明:

参数 必须 说明
access_token 调用接口凭证,使用用户态access_token,由/open/access_token获得
corpid 本机构或下属机构的机构ID;不填则默认为本机构
department_ids 部门ID列表
role_ids 角色ID列表, 参考角色类型
hide_creator 是否隐藏创建者 false:不隐藏(默认) true:隐藏
need_depart 是否返回用户的部门列表 0:不返回(默认) 1:返回

返回结果:

{
    "errmsg": "ok",
    "errcode": 0,
    "user_infos": [
        {
            "userid": "30045889",
            "roleId": 11,
            "child_id": "0",
            "department_ids": [
                6066987,
                6645258
            ]
        },
        {
            "userid": "30010756",
            "roleId": 13,
            "child_id": "30011403",
            "department_ids": [
                6066987,
                6645258
            ]
        }
    ]
}

返回值参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
user_infos.userid 用户ID
user_infos.roleId 角色ID
user_infos.child_id 家长子女ID
user_infos.department_ids 用户的部门列表
© 1998 - 2021 Tencent Inc. All Rights Reserved all right reserved,powered by ePaaS.更新时间: 2024-08-22 10:14:39

results matching ""

    No results matching ""

    results matching ""

      No results matching ""