# 员工事件回调

回调内容参见:校验回调路径,解密方式参见:data的加解密,将data解密后得到的内容即为以下描述的回调内容。业务方收到事件后,务必返回正确的signature,才会认为回调成功;服务器在5秒内收不到响应则断开连接。对于失败的回调,服务器会进行重试,总共重试3次,业务方可以使用事件ID进行消息排重。


事件列表:

事件类型 事件说明 事件分组 分组说明
staff_create 新增员工 staff 员工变更
staff_update 修改员工 staff 员工变更
staff_active 员工激活 staff 员工变更

回调内容:

注意:event_type根据不同事件会有所不同。

{
    "event_type": "staff_create",
    "message": {
        "_id": "8b2edc1f-a869-4d87-ae9f-1beec7a0c513",
        "_timestamp": 1602742001287,
        "staff_id": "92364603-96a8-4d9f-9762-c36e74437866",
        "open_user_id": "l1ZHBSAbRpxuMluQUKsuRorg_W-Ug",
        "staff_no": "01019527",
        "mobile": "13800138000",
        "email": "13800138000@163.com",
        "name": "小C",
        "avatar": "https://s0.seewo.com/wp-content/themes/maxhub/assets/images/favicon-e712669968.ico",
        "department_id": "8ca76fe2-e851-4adb-b386-775782eec8a6",
        "job_title": "软件工程师",
        "remark": "中国好员工"
    }
}

参数说明:

参数 说明
event_type 事件类型
message 事件内容
— _id 事件ID
— _timestamp 事件发生时的时间戳
— staff_id 员工ID
— open_user_id 用户ID,如果该员工对应的手机已在MAXHUB中注册,或者收到邀请后已激活为MAXHUB用户,则会返回用户ID;否则返回空
— staff_no 员工工号
— mobile 员工手机
— email 员工邮箱
— name 员工姓名
— avatar 员工头像
— department_id 部门ID
— job_title 职位
— remark 备注

事件列表:

事件类型 事件说明 事件分组 分组说明
staff_import 导入员工 staff 员工变更
staff_delete 删除员工 staff 员工变更

回调内容:

注意:event_type根据不同事件会有所不同。

{
    "event_type": "staff_import",
    "message": {
        "_id": "8b2edc1f-a869-4d87-ae9f-1beec7a0c513",
        "_timestamp": 1602742001287,
        "staff_ids": ["92364603-96a8-4d9f-9762-c36e74437866"]
    }
}

参数说明:

参数 说明
event_type 事件类型
message 事件内容
— _id 事件ID
— _timestamp 事件发生时的时间戳
— staff_ids 员工ID列表

事件列表:

事件类型 事件说明 事件分组 分组说明
staff_move 调整员工部门 staff 员工变更

回调内容:

{
    "event_type": "staff_move",
    "message": {
        "_id": "8b2edc1f-a869-4d87-ae9f-1beec7a0c513",
        "_timestamp": 1602742001287,
        "staff_ids": ["92364603-96a8-4d9f-9762-c36e74437866"],
        "department_id": "8ca76fe2-e851-4adb-b386-775782eec8a6"
    }
}

参数说明:

参数 说明
event_type 事件类型
message 事件内容
— _id 事件ID
— _timestamp 事件发生时的时间戳
— staff_ids 员工ID列表
— department_id 部门ID