# 1.1.1 获取用户基本信息

获取用户基本信息的OpenAPI接口,根据用户的account信息,查询到用户的基本信息:

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/manager/staff/account

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID 这里的fcid可以简单的通过@staff_account:domain 拼接, 如 @staff_finogeeks:im.finogeeks.com

请求参数说明:

参数 类型 是否必须 说明 默认值
account string 用户的账号,一般是关联客户系统的员工工号

响应Body:

{
    "id": "@staff_finogeeks:im.finogeeks.com", // 用户id
    "account": "finogeeks", //用户账号
    "name": "finogeeks",    // 用户名
    "avatar": "/api/v1/platform/apps/STAFF/profiles/@staff_staff1:im.finogeeks.com/avatar",  //用户头像
    "phone": "139000000000" //用户手机号
}

# 1.1.2 添加岗位信息

添加岗位信息,通过该接口可以添加岗位信息

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/manager/job

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明:

参数 类型 是否必须 说明 默认值
name string 岗位名称
updateUser string 更新人id,可以是 @staff_super:im.finogeeks.com

响应Body:

{
    "jobId":"60521589285c76000101b45f",
    "name":"测试岗位",
    "updateUser":"@staff_super:im.finogeeks.com",
    "updateTime":1615992201922,"mid":"M00000"
}

# 1.1.3 获取岗位信息

获取岗位信息,通过该接口,可以查询到人员的所有岗位信息

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/manager/job

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明:

参数 类型 是否必须 说明 默认值
page Int 分页页码 1
size Int 分页大小 10

响应Body:

{
    "result": [
        {
            "roleId": "60521589285c76000101b45f",
            "jobId": "60521589285c76000101b45f",
            "name": "测试岗位",
            "updateUserName": "超级管理员",
            "updateTime": 1615992201922
        },
        {
            "roleId": "60166fa115acae0001d8fa76",
            "jobId": "60166fa115acae0001d8fa76",
            "name": "管理",
            "updateUserName": "超级管理员",
            "updateTime": 1612083105537
        }
    ],
    "page": 1,
    "size": 10,
    "total": 2
}

# 1.1.4 获取角色权限列表

获取角色权限列表,通过该接口可以获取到管理后台人员角色的权限

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/manager/permission

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明:

参数 类型 是否必须 说明 默认值
page Int 分页页码 1
size Int 分页大小 10

响应Body:

{
    "result": [
        {
            "permissionId": "619867f0-765f-4f73-ac3f-0e5a0e067d85",
            "name": "管理员",
            "createTime": 1568016042710,
            "updateTime": 1615953637436,
            "updateUser": "@staff_super:im.finogeeks.com",
            "updateUserName": "管理员",
            "tid": "000000.finogeeks.com",
            "mid": "M00000"
        }
    ],
    "page": 1,
    "size": 10,
    "total": 1
}

# 1.1.5 添加角色

添加角色,通过该接口可以新增一个角色

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/manager/permission

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明:

参数 类型 是否必须 说明 默认值
name string 角色名称

响应Body:

{
    "permissionId": "619867f0-765f-4f73-ac3f-0e5a0e067d85",
    "name": "管理员"
}

# 1.1.6 添加组织

添加组织,通过该接口,可以新增组织信息

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/manager/group

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明:

参数 类型 是否必须 说明 默认值
name string 组织名称
parentId string 组织的父级id,如果是第一级组织,可以传空字符串
hotline string 组织电话
groupNumber string 组织编号
location Object 地理位置信息
location.longitude Double 经度
location.latitude Double 纬度
location.address string 地理位置信息
location.cityInformation Object 城市信息
location.cityInformation.province string
location.cityInformation.city string
location.cityInformation.area string

响应Body:

{
    "groupId":"6052273e285c76000101b461",
    "groupNumber":"1111",
    "name":"金易联组织",
    "hotline":"12345678",
    "location":{
        "longitude":113.417244,
        "latitude":22.383446,
        "address":"广东省中山市五桂山街道南坑尾",
        "cityInformation":{"province":"广东省", "city":"中山市","area":"五桂山街道"}
    },
    "parentId":"",
    "parentIds":[],
    "depth":1,
    "leaf":true,
    "excelHelper":"金易联组织"
}

# 1.1.7 获取所有组织信息

获取管理后台的所有组织信息

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/manager/group

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明

[
    {
        "groupId": "5e1c3fb0fe467f00016d659f",
        "groupNumber": "test111",
        "name": "一级组织测试",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 0,
            "latitude": 0,
            "address": "",
            "cityInformation": {
                "area": "",
                "city": "",
                "province": ""
            }
        },
        "createTime": 1578909714085,
        "updateTime": 1578909714085,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "",
        "parentIds": [ ],
        "depth": 1,
        "leaf": false,
        "excelHelper": "一级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",
        "id": "5e1c3fb0fe467f00016d659f"
    },
    {
        "groupId": "5e1c3fb0fe467f00016d65a0",
        "groupNumber": "test222",
        "name": "二级组织测试",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 0,
            "latitude": 0,
            "address": "",
            "cityInformation": {
                "area": "",
                "city": "",
                "province": ""
            }
        },
        "createTime": 1578909714174,
        "updateTime": 1578909714174,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "5e1c3fb0fe467f00016d659f",
        "parentIds": [
            "5e1c3fb0fe467f00016d659f"
        ],
        "depth": 2,
        "leaf": false,
        "excelHelper": "一级组织测试/二级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",
        "id": "5e1c3fb0fe467f00016d65a0"
    },
    {
        "groupId": "5e1c3fb0fe467f00016d65a1",
        "groupNumber": "test321",
        "name": "三级组织测试",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 0,
            "latitude": 0,
            "address": "",
            "cityInformation": {
                "area": "",
                "city": "",
                "province": ""
            }
        },
        "createTime": 1578909714263,
        "updateTime": 1578909714263,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "5e1c3fb0fe467f00016d65a0",
        "parentIds": [
            "5e1c3fb0fe467f00016d659f",
            "5e1c3fb0fe467f00016d65a0"
        ],
        "depth": 3,
        "leaf": true,
        "excelHelper": "一级组织测试/二级组织测试/三级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",  
        "id": "5e1c3fb0fe467f00016d65a1"
    },
    {
        "groupId": "5e1c3fb0fe467f00016d65a2",
        "groupNumber": "test444",
        "name": "四级组织测试",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 0,
            "latitude": 0,
            "address": "",
            "cityInformation": {
                "area": "",
                "city": "",
                "province": ""
            }
        },
        "createTime": 1578909713819,
        "updateTime": 1578909713819,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "5e1c3fb0fe467f00016d65a1",
        "parentIds": [
            "5e1c3fb0fe467f00016d659f",
            "5e1c3fb0fe467f00016d65a0",
            "5e1c3fb0fe467f00016d65a1"
        ],
        "depth": 4,
        "leaf": false,
        "excelHelper": "一级组织测试/二级组织测试/三级组织测试/四级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",
        "id": "5e1c3fb0fe467f00016d65a2"
    },
    {
        "groupId": "5e1c3fb0fe467f00016d65a3",
        "groupNumber": "test555",
        "name": "五级组织测试",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 0,
            "latitude": 0,
            "address": "",
            "cityInformation": {
                "area": "",
                "city": "",
                "province": ""
            }
        },
        "createTime": 1578909713907,
        "updateTime": 1578909713907,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "5e1c3fb0fe467f00016d65a2",
        "parentIds": [
            "5e1c3fb0fe467f00016d659f",
            "5e1c3fb0fe467f00016d65a0",
            "5e1c3fb0fe467f00016d65a1",
            "5e1c3fb0fe467f00016d65a2"
        ],
        "depth": 5,
        "leaf": false,
        "excelHelper": "一级组织测试/二级组织测试/三级组织测试/四级组织测试/五级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",
        "id": "5e1c3fb0fe467f00016d65a3"
    },
    {
        "groupId": "5e1c3fb0fe467f00016d65a4",
        "groupNumber": "test666",
        "name": "六级组织测试",
        "hotline": "222222",
        "contactsName": "",
        "location": {
            "longitude": 111,
            "latitude": 111,
            "address": "测试地址",
            "cityInformation": {
                "area": "南山区",
                "city": "深圳市",
                "province": "广东省"
            }
        },
        "createTime": 1578909713995,
        "updateTime": 1578909713995,
        "updateUser": "@staff_super:000000.finogeeks.com",
        "parentId": "5e1c3fb0fe467f00016d65a3",
        "parentIds": [
            "5e1c3fb0fe467f00016d659f",
            "5e1c3fb0fe467f00016d65a0",
            "5e1c3fb0fe467f00016d65a1",
            "5e1c3fb0fe467f00016d65a2",
            "5e1c3fb0fe467f00016d65a3"
        ],
        "depth": 6,
        "leaf": true,
        "excelHelper": "一级组织测试/二级组织测试/三级组织测试/四级组织测试/五级组织测试/六级组织测试",
        "tid": "000000.finogeeks.com",
        "mid": "M00000",  
        "id": "5e1c3fb0fe467f00016d65a4"
    }
]

# 1.1.8 修改组织信息

修改组织信息,通过该接口可以修改组织的信息

请求方式:PUT

请求地址:{API_HOST}/api/v1/open/swan/manager/group/:groupId

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明

参数 类型 是否必须 说明 默认值
name string 组织名称
parentId string 组织的父级id,如果是第一级组织,可以传空字符串
hotline string 组织电话
groupNumber string 组织编号

# 1.1.9 新增员工信息

新增一个员工信息

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/manager/staff

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_super:im.finogeeks.com"

请求参数说明

参数名 类型 是否必须 描述
account String 账号,企业员工的账号,一般为企业内容的工号,需保证每个账号唯一,用该账号登录金易联的APP
company String 公司信息
dataGroups String[] 数据权限
email String 电子邮箱
employeeNo String 工号
employmentTime Integer 从业年限
group String 分组:企业组织架构的分组id;
hotline String 座机号
jobs String[] 员工的岗位
name String 员工姓名,企业员工的真实姓名
password String 密码,如果登录对接的企业的CRM系统,那么该字段就不需要进行导入;
permissionRoles String[] 管理后台页面权限
phone String 手机号
position String 位置
power bool 接单权限
practiceNum String 执业编号
showGroup bool 展示组织
showJob bool 展示岗位
wechat String 微信号
zoneStatus Integer 工作室状态

# 1.1.10 获取员工信息

获取员工信息

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/manager/staff/:staffId

请求头部:

| key                  | value                           |
| -------------------- | ------------------------------- |
| Content-Type         | application/json                |
| X-Consumer-Custom-ID | "@staff_super:im.finogeeks.com" |

请求参数说明

| 参数    | 类型   | 是否必须 | 说明     | 默认值 |
| ------- | ------ | -------- | -------- | ------ |
| staffId | String | 是       | 员工fcid | 无     |

响应Body:

```
{
    "id": "@staff_staff3:im.ccbfund.cn",
    "account": "staff3",
    "groupNumber": "test002",
    "name": "staff3",
    "avatar": "",
    "phone": "15366988854",
    "email": "",
    "hotline": "",
    "employmentTime": 0,
    "practiceNum": "",
    "notice": {
        "dispatch": true,
        "rush": true
    },
    "online": true,
    "power": true,
    "roles": ["客服", "岗位-客户经理"],
    "jobs": [{
        "jobId": "317e9656-ddb4-418f-b625-ffa39c21916d",
        "name": "客服",
        "updateUser": "@staff_super:im.ccbfund.cn",
        "updateTime": 1583303254901,
        "mid": "M00000"
    }, {
        "jobId": "f9fac3f2-5aed-4061-bbe5-23d759eb8c87",
        "name": "岗位-客户经理",
        "updateUser": "@staff_super:im.ccbfund.cn",
        "updateTime": 1577693415724,
        "mid": "M00000"
    }],
    "roleNames": ["客服", "岗位-客户经理"],
    "permissionRoles": [{
        "permissionId": "0d23e732-9d62-41d5-a656-c52099bad522",
        "name": "全部",
        "permissionsView": null,
        "fanPermission": 1,
        "contentDispatchPermission": 1,
        "orderPermission": 1,
        "auditPermission": 1,
        "staffAuditPermission": 0,
        "knowledgeAuditPermission": 0,
        "timelinePermission": 1,
        "compliancePermission": 1,
        "shareNetdiskPermission": 1,
        "createProductPermission": 1,
        "createTime": 1570527221084,
        "updateTime": 1577698821982,
        "updateUser": "@staff_super:im.ccbfund.cn",
        "updateUserName": "超级管理员",
        "tid": "im.ccbfund.cn",
        "mid": "M00000"
    }],
    "fanPermission": 1,
    "contentDispatchPermission": 1,
    "showJob": true,
    "showGroup": true,
    "employeeNo": "",
    "group": {
        "groupId": "b147a860-2556-11ea-a05b-6d772c240a5e",
        "groupNumber": "test002",
        "name": "api_test_组织",
        "hotline": "",
        "contactsName": "",
        "location": {
            "longitude": 113,
            "latitude": 23,
            "address": "广东省广州市天河区猎德街道珠江新城(地铁站)南岳大厦",
            "cityInformation": {
                "area": "天河区",
                "city": "广州市",
                "province": "广东省"
            }
        },
        "createTime": 1577086485990,
        "updateTime": 1577443991414,
        "updateUser": "@staff_super:im.ccbfund.cn",
        "parentId": "",
        "parentIds": [],
        "depth": 1,
        "leaf": true,
        "excelHelper": "api_test_组织",
        "tid": "im.ccbfund.cn",
        "mid": "M00000"
    },
    "department": "api_test_组织",
    "view": [{
        "viewId": "1000",
        "viewName": "首页"
    },  {
        "viewId": "6300",
        "viewName": "工作室列表"
    }],
    "dataGroups": [{
        "groupId": "b147a860-2556-11ea-a05b-6d772c240a5e",
        "name": "api_test_组织"
    }],
    "dataGroupsAll": [{
        "groupId": "b147a860-2556-11ea-a05b-6d772c240a5e",
        "name": "api_test_组织"
    }],
    "updateTime": 1596611804249,
    "updateUser": {
        "staffId": "",
        "account": "",
        "name": ""
    },
    "state": 0,
    "zoneStatus": 1,
    "wechat": "rghyjhh",
    "company": {
        "catalog": "",
        "name": "",
        "telephone": ""
    },
    "section": "",
    "position": "",
    "isExperience": false,
    "everLogin": false,
    "visitingCardDetail": {
        "likedUser": 3,
        "viewUser": 12,
        "viewUserDetail": ["@retail_7ea224b0-ea66-11e9-82b8-a508f0dcc6fe:im.ccbfund.cn", "@retail_u1004:im.ccbfund.cn"],
        "voiceIntroduction": {
            "resourceId": "696d2e63636266756e642e636e5f2a5c093e9fc40001aef69a",
            "duration": 4419.125
        },
        "videoIntroduction": {
            "name": "IMG_1114.mp4",
            "resourceId": "696d2e63636266756e642e636e5f2a52743e9fc40001aef68e",
            "videoThumbnail": "",
            "width": 828,
            "height": 1792,
            "orientation": "",
            "type": "video/mp4"
        },
        "photoIntroduction": "696d2e63636266756e642e636e5f2a528a3e9fc40001aef690",
        "videoThumbnail": "",
        "certificate": [{
            "certId": "ZS19112647664251460121",
            "name": "银行从业资格证",
            "url": "https://oct.ccbfund.cn/api/v1/netdisk/download/5ddd0759baf29e00010bd095",
            "briefName": "",
            "type": "bank",
            "tid": "im.ccbfund.cn",
            "updator": "@staff_super:im.ccbfund.cn",
            "updatorUserName": "",
            "updateTime": 1574766425176,
            "mid": "M00000"
        }],
        "template": "classic"
    }
}
```

# 1.1.11 删除员工

删除员工

请求方式:PUT

请求地址:{API_HOST}/api/v1/open/swan/manager/staff/deactive/staffs

请求头部:

| key                  | value                           |
| -------------------- | ------------------------------- |
| Content-Type         | application/json                |
| X-Consumer-Custom-ID | "@staff_super:im.finogeeks.com" |

请求参数说明

| 参数   | 类型     | 是否必须 | 说明                                        | 默认值 |
| ------ | -------- | -------- | ------------------------------------------- | ------ |
| staffs | String[] | 是       | 需要删除的员工fcidl列表,该删除操作是软删除 | 无     |