前言
一键免登录功能仅针对特约客户开放
API接口
前置说明
该接口均是由你的服务端发起的http调用,接口响应按标准的restful风格,请求体与响应体如有的,均为json格式
所有的请求头需要包含accessId及accessToken
accessId即系统分配给你的标识ID
accessToken即系统分配给你的访问授权密钥
请求的基础URL为: https://api.xiaolanben.com
请求示例
curl -X POST --header 'Content-Type: application/json' --header 'accessToken: 你的token' --header 'accessId: 你的id' -d '{"mobile": "139xxxx1234","routing": "/newUser/search/companySearch"}' 'https://api.xiaolanben.com/blue-crm/api/v1/open/coreSystem/getLoginUrl'
判断指定的手机号是否允许一键登录
POST /blue-crm/api/v1/open/coreSystem/existByMobile
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
mobile | String | body | 必须 登录系统的手机号 |
出参
参数名 | 数据类型 | 备注 |
isExist | Boolean | 如果返回true,则表示允许一键登录;否则不允许。注意:该接口不校验企业有效期 |
accountId | Int | 登录账号ID 等同于后续接口的staffId |
获取一键登录链接接口
POST /blue-crm/api/v1/open/coreSystem/getLoginUrl
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
mobile | String | body | 必须 登录系统的手机号 |
customDomain | String | body | 非必传。如果在小蓝本配置过自定义域名的,则可以传入该域名(需要符合URL标准格式)。如:https://leads.xiaolanben.com |
appCategory | Int | body | 非必传,在未传入customDomain有效。如果您开通了多个版本的拓客,则可以通过该值控制想要的版本路径。0通过版/2金融版/3财税版/4会展版/5招商版/6物流版 |
routing | String | body | 非必传。页面路由,不能带#符,具体参考小蓝本官方页面路由。如:/newUser/search/companySearch 或 /newUser/company?eid=q94e84a8422fc4aeb98d387145ccc4f68 |
returnUrl | String | body | 非必传。在用户免登登录超时或失败时,系统会自动回跳转回该URL(需要符合URL标准格式) |
出参
参数名 | 数据类型 | 备注 |
accountId | Int | 登录账号ID 等同于后续接口的staffId |
url | String | 打开登录页的URL |
异常信息
当获取登录链接出错时,系统会以http status 非200方式返回,响应体格式为
{"trackingId": "b58e0862-bacf-4257-aac3-27db84128211","errors": [{"code": 400,"message": "参数xxx未传入"}]}
主要的错误码如下:
http状态码 | 错误原因 |
400 | 入参错误,如必传参数未传 |
401 | 传入的accessId或accessToken错误 |
402 | 系统已过期 |
404 | 手机号对应的账号未配置 |
410 | 手机号对应的账号已离职 |
获取所有部门列表
GET /blue-crm/api/v1/open/coreSystem/departments
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
出参
参数名 | 数据类型 | 备注 |
[] | 列表数组 | 部门列表数组 |
id | Long | 部门ID |
name | String | 部门名称 |
ownerId | Int | 部门负责人 |
parentId | Long | 上级部门ID |
获取所有角色列表
GET /blue-crm/api/v1/open/coreSystem/roles
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
出参
参数名 | 数据类型 | 备注 |
[] | 列表数组 | 角色列表数组 |
id | Long | 角色ID |
name | String | 角色名称 |
dataACL | String | 数据权限代码 |
dataACLDesc | String | 数据权限描述 |
productPrivilegeDescriptions | List | 产品权限码 |
–productName | String | 产品名称 |
–enabledPrivilegeCount | Int | 开启权限数 |
systemPrivilegeDescriptions | List | 系统权限码 |
–productName | String | 产品名称 |
–enabledPrivilegeCount | Int | 开启权限数 |
分页获取员工列表
GET /blue-crm/api/v1/open/coreSystem/staffs
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
pageIndex | Int | query | 必须 页面索引,从1开始 |
pageSize | Int | query | 必须 页面大小,需要介于1~100 |
search | String | query | 非必须 搜索关键字,从手机号,姓名中搜索 |
departmentId | Long | query | 非必须 部门ID |
status | Int | query | 非必须 授权0/未授权2/离职1 |
出参
参数名 | 数据类型 | 备注 |
pageIndex | Int | 页面索引 |
pageSize | Int | 页面大小 |
totalCount | Long | 总记录数 |
data | 列表数组 | 员工列表数组 |
–staffId | Int | 员工ID |
–realName | String | 员工名称 |
–mobile | String | 手机号 打码返回 |
–isAdmin | Int | 是否管理员 1是 其它不是 |
–leaderId | Int | 上级领导ID |
–leader | String | 上级领导 |
–departmentId | Long | 部门ID |
–department | String | 部门名称 |
–roleId | Long | 角色ID |
–role | String | 角色名称 |
–status | Int | 状态码 |
–statusStr | String | 状态 |
–loginAt | String | 最后登录时间 |
新增员工
POST /blue-crm/api/v1/open/coreSystem/staff
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
mobile | String | body | 必须 手机号 必须符合手机号格式 |
realName | Int | body | 必须 姓名 |
departmentId | Long | body | 必须 所属部门ID |
leaderId | Int | body | 非必须 直属领导ID |
roleId | Long | body | 必须 角色ID。注 :不允许选择超级管理员角色。 |
status | Int | body | 必须 授权0/未授权2 注:仅限这两个值 |
visibleProductCodes | List<String> | body | 必须 可见范围 customer 拓客/crm CRM/grow 培育/touch 触达 ,如[“customer“,”crm“] |
出参
无 http响应码为204
编辑员工
PUT /blue-crm/api/v1/open/coreSystem/staff
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
staffId | Int | body | 必须 当前编辑的员工ID |
mobile | String | body | 必须 手机号 必须符合手机号格式 |
realName | Int | body | 必须 姓名 |
departmentId | Long | body | 必须 所属部门ID |
leaderId | Int | body | 非必须 直属领导ID |
roleId | Long | body | 必须 角色ID。注:超级管理员不要修改这个角色,否则系统下次操作会报错。其它员工不要选择超级管理员角色 |
status | Int | body | 必须 授权0/未授权2 注:仅限这两个值 |
visibleProductCodes | List<String> | body | 必须 可见范围 customer 拓客/crm CRM/grow 培育/touch 触达 ,如[“customer“,”crm“] |
出参
无 http响应码为204
员工离职
POST /blue-crm/api/v1/open/coreSystem/staff/leave
离职后的员工记录会在员工列表中出现,是软删除状态。不会占用账号数
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
staffIds | List<Int> | query | 必须 要离职的员工ID,多个则以,号分割。如…/staff?staffIds=1,2,3 |
出参
无 http响应码为204
删除员工
DELETE /blue-crm/api/v1/open/coreSystem/staff
删除过的员工,不会再出现在员工列表中
入参
参数名 | 数据类型 | 数据域 | 备注 |
accessId | String | header | 必须 系统分配的标识ID |
accessToken | String | header | 必须 系统分配的授权密钥 |
staffIds | List<Int> | query | 必须 要删除的员工ID,多个则以,号分割。如…/staff?staffIds=1,2,3 |
出参
无 http响应码为204