https://api-bj.clink.cn/xxxxxx?
&AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-09-11T12:02:34Z
&Signature=A4GDuUoWiFj59wQ0Bfq%2FJnB%2BSRU%3D
...
欢迎使用“AICC” API 服务。您可以直接通过标准化的 HTTPS 接口,快速实现平台与自有系统的集成,管理平台的数据配置、呼叫控制、通话记录等各种资源。我们同时还提供了 开发者工具套件(SDK),对 API接口调用进行了封装。推荐您优先使用 SDK ,可以更方便地进行系统集成。
通信协议
出于安全考虑,平台只提供 HTTPS 协议访问,只支持服务端调用,不支持浏览器访问。
字符编码
请求及返回结果都使用 UTF-8 字符集编码。
接入地址
公有云平台:
北京平台:https://api-bj.clink.cn
上海平台:https://api-sh.clink.cn
其它平台: 请咨询技术支持
公共请求参数
每个 API 接口都需要以 URL Parameter 的形式携带公共请求参数,对请求进行鉴权。
名称 | 类型 | 是否必须 | 说明 |
---|---|---|---|
AccessKeyId |
String |
是 |
客服云平台颁发给客户端的访问密钥 ID。 |
Expires |
String |
是 |
签名的有效时间(秒),最小值为 1,最大值为 86400(24 小时)。 |
Timestamp |
String |
是 |
签名的时间戳,格式遵循 ISO 8601 标准,按照格式 “ yyyy-MM-ddTHH:mm:ssZ ” 进行格式化。示例:2018-01-01T12:00:00Z表示北京时间2018年01月01日20点00分00秒 |
Signature |
String |
是 |
根据请求参数和访问密钥计算的签名。 |
请求示例
https://api-bj.clink.cn/xxxxxx?
&AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-09-11T12:02:34Z
&Signature=A4GDuUoWiFj59wQ0Bfq%2FJnB%2BSRU%3D
...
公共返回参数
名称 | 类型 | 说明 |
---|---|---|
requestId |
String |
请求 ID。无论请求 API 服务是否成功,客服云平台都会返回每个请求的唯一 ID 到客户端。 |
签名(Signature)的计算需要使用访问密钥对:AccessKeyId/AccessKeySecret。访问密钥对可以通过登录系统管理后台,在【系统管理-系统对接-接口密钥】模块自助生成。每个访问密钥对可以设置不同的接口访问控制权限。
签名算法
签名(Signature)用于对 API 请求进行身份认证和鉴权,每个请求必须具有唯一的签名。 签名的具体实现是以 AccessKeySecret 为密钥,使用 hmac-sha1 算法对用户请求参数(QueryString)、访问密钥ID(AccessKeyId)、签名有效时间(Expires)、签名当前时间戳(Timestamp)做哈希计算。 具体步骤如下:
1. GET示例:
https://api-bj.clink.cn/cc/list_clients?
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-10-12T10:18:12Z
&limit=10
&offset=0
&qno=0000
&cnos[0]=0000
&cnos[1]=0001
拼接要加密的字符串规则:请求方法(GET)+ 请求域名(api-bj.clink.cn)+ 请求参数。其中,访问密钥ID(AccessKeyId)、签名有效时间(Expires)、签名时间戳(Timestamp)分别与上面的公共请求参数相对应,请求参数具体拼接规则为:
首先对用户请求参数的 name 进行字典排序
AccessKeyId,Expires,Timestamp,cnos[0],cnos[1],limit,offset,qno
通过&符号连接用户请求参数的 name 和 value
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af&Expires=60&Timestamp=2018-10-12T10:18:12Z&&cnos[0]=0000&cnos[1]=0001&limit=10&offset=0&qno=0000
Timestamp为UTC时间格式,所有请求参数都要进行UrlEncode
2018-10-12T10:18:12Z => 2018-10-12T10%3A18%3A12Z
cnos[0] => cnos%5B0%5D
cnos[1] => cnos%5B1%5D
参数urlParam结果
GETapi-bj.clink.cn/cc/list_clients?AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af&Expires=60&Timestamp=2018-10-12T10%3A18%3A12Z&cnos%5B0%5D=0000&cnos%5B1%5D=0001&limit=10&offset=0&qno=0000
计算Signature
Signature = URLEncode(base64(hmac-sha1(AccessKeySecret, urlParam)))
最终请求地址
https://api-bj.clink.cn/cc/list_clients?
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-10-12T10%3A18%3A12Z
&limit=10
&offset=0
&qno=0000
&cnos%5B0%5D
&cnos%5B1%5D
&Signature=pDS5pcYkw3SqQV0zk312iCaQJpg%3D
2. POST示例:
https://api-bj.clink.cn/cc/online?
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-10-12T10:18:12Z
请求体
{
"qno":"0000",
"cnos":["0000","0001"],
"bindTel":"138xxxx8888",
"bindType":1,
"status":1
}
拼接要加密的字符串规则:请求方法(POST)+ 请求域名(api-bj.clink.cn)+ 请求参数(由于POST方法URL中只有公共参数,其他参数通过请求体传递,所以计算签名时只需考虑公共参数)。其中,访问密钥ID(AccessKeyId)、签名有效时间(Expires)、签名时间戳(Timestamp)分别与上面的公共请求参数相对应,请求参数具体拼接规则为:
首先对用户请求参数的 name 进行字典排序
AccessKeyId,Expires,Timestamp
通过&符号连接用户请求参数的 name 和 value
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af&Expires=60&Timestamp=2018-10-12T10:18:12Z
Timestamp为UTC时间格式,所有请求参数都要进行URL转码
2018-10-12T10:18:12Z => 2018-10-12T10%3A18%3A12Z
参数urlParam结果
POSTapi-bj.clink.cn/cc/online?AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af&Expires=60&Timestamp=2018-10-12T10%3A18%3A12Z
计算Signature
Signature = URLEncode(base64(hmac-sha1(AccessKeySecret, urlParam)))
最终请求地址
https://api-bj.clink.cn/cc/online?
AccessKeyId=b1fcdc6c62be261cf97b00b25be6a2af
&Expires=60
&Timestamp=2018-10-12T10%3A18%3A12Z
&Signature=pDS5pcYkw3SqQV0zk312iCaQJpg%3D
|
API 的返回结果统一为 JSON 格式,使用 UTF-8 字符集编码。为了方便阅读,文中的示例有换行和缩进处理,实际返回结果无换行和缩进处理。
正常返回示例
接口调用成功后,会返回接口调用结果和请求 ID(requestId),HTTP 状态码为 2xx。
示例
{
"requestId": "c4bc3588-29bd-44be-91d4-d846c8eea64f"
}
分页示例:
{
"requestId": "77efcfd8-db8c-4f5c-bdb8-d804cfce7423",
"pageNumber": 1,
"pageSize": 10,
"totalCount": 2,
"objects": [
{
"field1":"value1",
"field2":"value2"
},
{
"field3":"value3",
"field4":"value4"
}
]
}
异常返回示例
接口调用失败或出错后,会返回错误码、错误信息和请求 ID,HTTP 状态码为 4xx 或 5xx。
您可以根据接口错误码和错误信息排查错误。当您无法排查错误时,可以联系我们的技术支持,并提供 requestId。
示例
{
"requestId": "778a71c5-7f62-4bbf-b5c2-383a71227b67",
"error": {
"code": "ResourceNotFound",
"message": "指定的资源不存在"
}
}
您可以在【系统管理-系统对接-IP白名单】模块中设置对接系统的 IP 白名单,进一步提高数据安全性。如果设置了 IP 白名单,系统只会对指定的 IP 提供 API 服务。系统支持两种 IP 格式:
指定 IP 地址,如:10.10.1.1 。
指定 IP 地址段,如:10.10.1.* - 10.10.2.* 。
错误码分为两种类型:
客户端错误:该类型错误由客户端引起,例如无效的请求参数、用户没有权限访问资源等。
服务器错误:该类型错误在服务端产生,由系统异常引起,没有固定的类型。
示例
{
"requestId": "842ab2a6-3732-4c03-8ab7-c7f83180fb0c",
"error": {
"code": "ResourceNotFound",
"message": "指定的资源不存在"
}
}
本节列出了所有操作都可能返回的常见客户端错误。
code | HTTP Status | message |
---|---|---|
AuthFailure |
401 |
身份验证失败。 |
InvalidParameter |
400 |
请求中指定的参数无效,不受支持或无法使用。 返回的消息提供了错误值的说明。 |
MissingParameter |
400 |
请求缺少必需参数。 |
ResourceNotFound |
404 |
请求资源不存在。 |
MissingRequestBody |
400 |
缺少请求body。 |
MissingAuthenticationToken |
400 |
请求必须包含有效的访问密钥ID。 |
HttpMediaTypeNotSupported |
400 |
HttpMediaType不支持,只支持application/json |
HttpRequestMethodNotSupported |
405 |
HTTP方法不支持。 |
UnauthorizedOperation |
403 |
您无权执行此操作。请确认您的密钥ID有此权限 |
UnknownParameter |
400 |
提供了未知或未识别的参数。 |
SignaturesExpired |
403 |
签名过期 |
TooManyRequests |
429 |
请求超限 |
code | HTTP Status | message |
---|---|---|
InternalError |
500 |
发生内部错误。 重试您的请求,但如果问题仍然存在,请联系技术支持。 |
GET /crm/customer_params
名称 |
类型 |
描述 |
customerParams |
Object[] |
可用作查询参数字段集合 |
请求示例
https://api-bj.clink.cn/crm/customer_params
&<公共请求参数>
返回示例
{
"requestId":"cdab1851-5426-44e5-8d5e-bb06c085cff1",
"customerParams":[
{
"id":49,
"name":"客户归属"
},
{
"id":44,
"name":"客户名称"
},
{
"id":46,
"name":"电话"
},
{
"id":43,
"name":"邮箱"
},
{
"id":45,
"name":"性别"
},
{
"id":48,
"name":"等级"
},
{
"id":52,
"name":"修改人"
},
{
"id":51,
"name":"创建人"
}
]
}
GET /crm/list_customers
名称 |
类型 |
是否必需 |
描述 |
customerParams |
String |
false |
json格式字符串 1.参数说明: 通过调用"获取可用查询参数"接口返回的可用参数进行参数拼装 例: (1).需要查询客户名称为"张三"的客户资料,首先通过customerParams参数解释接口拿到客户名称字段对应的id值 (2).使用客户名称字段对应的id作为key,"张三"作为value,拼装json字符串 (3).将参数转为json字符串并进行url编码,utf-8 |
startTime |
long |
false |
创建时间查询范围-开始时间,秒级时间戳 |
endTime |
long |
false |
创建时间查询范围-结束时间,秒级时间戳 |
updateStartTime |
long |
false |
修改时间查询范围-开始时间,秒级时间戳 |
updateEndTime |
long |
false |
修改时间查询范围-结束时间,秒级时间戳 |
lastRepeatPromoteStartTime |
long |
false |
最近一次重复推广时间查询范围-开始时间,秒级时间戳 |
lastRepeatPromoteEndTime |
long |
false |
最近一次重复推广时间查询范围-结束时间,秒级时间戳 |
retrieveStartTime |
long |
false |
回收时间查询范围-开始时间,秒级时间戳 |
retrieveEndTime |
long |
false |
回收时间查询范围-结束时间,秒级时间戳 |
assignStartTime |
long |
false |
分配时间查询范围-开始时间,秒级时间戳 |
assignEndTime |
long |
false |
分配时间查询范围-结束时间,秒级时间戳 |
lastContactStartTime |
long |
false |
最后一次联系时间查询范围-开始时间,秒级时间戳 |
lastContactEndTime |
long |
false |
最后一次联系时间查询范围-结束时间,秒级时间戳 |
offset |
Integer |
false |
偏移量,范围 大于等于0。默认值为 0 |
limit |
Integer |
false |
查询条数,范围 10-100。默认值为 10 |
字段名称 |
描述 |
示例 |
客户名称 |
String类型字符串 |
{"客户名称字段的id":"客户名称"} |
电话 |
String类型字符串 |
{"客户电话的字段id":"客户电话"} |
客户归属 |
0:全体共享; 1:员工组共享; 2:员工私有; 3:无归属 |
当取值为0时:{"客户归属的id":{"shareType":0}}, 当取值为1时:{"客户归属的id":{"shareType":1,"share":"需要传的员工组号"}}, 当取值为2时:{"客户归属的id":{"shareType":2,"share":"需要传的员工工号"}}, 当取值为3时:{"客户归属的id":{"shareType":3} |
等级 |
0:普通 1:vip |
{"等级字段的id":0} |
性别 |
0:男 1:女 |
{"性别字段的id":0} |
来源 |
0:呼叫中心, 1:在线咨询, 2:微信,3:人工添加,4:小程序,5:微博,6:电子邮件, 7:app端,8:企业微信,9:微信客服(独立版),10:第三方接入,15:百度营销,16:自定义渠道, 18:APP, 19:微信客服,21:企微客服,23: 飞书,24:座席助手,25:企微助手,30:接口创建 |
{"来源字段的id":0} |
外部企业客户ID |
String类型字符串 |
{"外部企业客户ID字段的id":"外部企业客户ID"} |
级联以及复选框 |
字符串类型,多个使用英文逗号分隔 |
例:北京,北京市 |
定义字段中的日期、时间、日期时间 |
开始时间,结束时间(如需使用自定义时间查询条件,则开始时间和结束时间都必传) |
例: 时间日期 2019/09/09 00:00:00,2019/09/09 23:59:59 日期 2019/09/09,2019/09/09 时间 00:00:00,23:59:59 |
请求示例
customerParams格式:"{"45":"男","46":"17600055818"}"
如果需要传客户归属参数并且取值为0或者是3,则传参示例为
{"49":{"shareType":0}}
或者
{"49":{"shareType":3}}
如果需要传客户归属参数并且取值为1或者是2,则传参示例为
{"49":{"shareType":1,"share":"0001"}}
或者
{"49":{"shareType":2,"share":"0001"}}
请求URL
https://api-bj.clink.cn/crm/list_customers
&offset=0
&limit=10
&startTime=1536201058
&endTime=1536201058
&customerParams=%7b%2245%22%3a%22%e7%94%b7%22%2c%2246%22%3a%2217600055818%22%7d
&<公共请求参数>
名称 | 类型 | 描述 |
---|---|---|
key |
integer |
客户资料字段id,当key的值等于-1时对应的value值是客户id |
name |
string |
字段中文描述 |
value |
string |
字段值 |
encryptValue |
string |
字段加密值 |
system |
integer |
是否为系统字段, 1:系统字段 ; 0:客户自定义字段 |
返回示例
{
"requestId":"4ed8f07d-683e-49b6-8759-c9c3ad08da5e",
"pageNumber":1,
"pageSize":15,
"totalCount":1,
"customers":[
[
{
"key":342,
"name":"客户名称",
"value":"访客***310b",
"encryptValue": null,
"system":1
},
{
"key":343,
"name":"性别",
"value":"男",
"encryptValue": null,
"system":1
},
{
"key":344,
"name":"电话",
"value":"[176****5818]",
"encryptValue": "[TOWQ5MzdjYTczZGNkYTEzZDEyYTk0YzE3NjRkYjMxOWE=]",
"system":1
},
{
"key":347,
"name":"等级",
"value":"普通",
"encryptValue": null,
"system":1
},
{
"key":540,
"name":"来源",
"value":"呼叫中心",
"encryptValue": null,
"system":1
},
{
"key":348,
"name":"客户归属",
"value":"",
"encryptValue": null,
"system":1
},
{
"key":352,
"name":"创建时间",
"value":"1571295181774",
"encryptValue": null,
"system":1
}
]
]
}
GET /crm/list_customer_field
名称 | 类型 | 描述 |
---|---|---|
id |
integer |
自定义字段的id |
key |
string |
对应的系统字段的字段名 |
name |
string |
字段值 |
type |
integer |
1:单行文本-不限制,2:单行文本-数值,3:单行文本-邮箱,4:单行文本-IP地址,5:多行文本,6:下拉列表,7:自定义级联,8:地区级联 9:单选框,10:复选框,11:日期时间,12:日期,13:时间,100:手机号码,101:身份证号,102:银行卡号 |
defaults |
integer |
是否为系统默认字段,0:否,1是 |
property |
String |
对应不同的类型的字段中的值具体见: [property字段说明] |
priority |
Integer |
优先级,决定展示顺序 |
required |
Integer |
是否必填,0:否,1:是 |
unique |
Integer |
是否唯一,0:否,1:是 |
clientReadonly |
Integer |
普通座席只读,0:否,1:是 |
clientHidden |
Integer |
普通座席隐藏,0:否,1:是 |
searchDisplay |
Integer |
查询是否展示,0:否,1:是 |
hidden |
Integer |
是否启用,0:是,1: 否 |
property字段说明
下拉列表的property
[
{
"name":"选项1",
"selected":1
}
]
自定义级联和地区级联的property
[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"大兴区",
"selected":1
},
{
"title":"朝阳区",
"selected":0
}
]
}
]
},
{
"title":"河北省",
"selected":0,
"options":[
{
"title":"石家庄",
"selected":1
},
{
"title":"邢台",
"selected":0
}
]
}
]
单选框和复选框的property
[
{
"name":"选择1",
"selected":0
},
{
"name":"选择2",
"selected":1
}
]
返回示例
{
"requestId":"963e99e3-5a49-4562-a16e-38b9f981d4fe",
"customerFields":[
{
"id":440,
"key":null,
"name":"测试下拉列表",
"type":6,
"defaults":0,
"property":[{"name":"1","selected":1},{"name":"2","selected":0}],
"priority":18,
"required":1,
"unique":1,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":1,
"hidden":0
},
{
"id":9662,
"key":null,
"name":"测试复选框123",
"type":10,
"defaults":0,
"property":[{"name":"并行节点1","selected":0}],
"priority":38,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":1,
"hidden":0
},
{
"id":13450,
"key":null,
"name":"这是一个列表",
"type":6,
"defaults":0,
"property":[{"name":"你好啊啊","selected":1},{"name":"你好啊哈哈哈","selected":0}],
"priority":44,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13451,
"key":null,
"name":"单选123",
"type":9,
"defaults":0,
"property":[{"name":"13123","selected":1},{"name":"23123","selected":0}],
"priority":45,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13452,
"key":null,
"name":"日期时间字段",
"type":11,
"defaults":0,
"property":null,
"priority":46,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13453,
"key":null,
"name":"日期字段",
"type":12,
"defaults":0,
"property":null,
"priority":47,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13454,
"key":null,
"name":"时间字段",
"type":13,
"defaults":0,
"property":null,
"priority":48,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13455,
"key":null,
"name":"自定义级联",
"type":7,
"defaults":0,
"property":[{"title":"你好","options":[{"title":"你好啊","options":[{"title":"你好可爱啊"}]}]}],
"priority":49,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13456,
"key":null,
"name":"你好",
"type":8,
"defaults":0,
"property":[{"title":"北京","options":[{"title":"北京市","options":[{"title":"东城区"}]}]}],
"priority":50,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
}
]
}
POST /crm/create_customer
名称 |
类型 |
是否必需 |
描述 |
name |
String |
后台配置 |
客户名称 |
tel |
String[] |
后台配置 |
客户号码 |
level |
Integer |
后台配置 |
客户等级,0:普通,1:VIP |
shareType |
Integer |
true |
归属类型,0:全体共享、1:员工组共享、2:员工私有、3:无归属 |
share |
String |
false |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
sex |
Integer |
后台配置 |
客户性别,0:男 、1:女 |
String |
后台配置 |
邮箱 |
|
remark |
String |
后台配置 |
备注 |
address |
String |
后台配置 |
地址 |
customize |
Object[] |
true |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
externalId |
String |
false |
外部企业客户ID (第三方平台 ID) |
source |
Integer |
false |
来源。24:座席助手,30:接口创建。默认接口创建 |
visitorIds |
String[] |
false |
访客ID |
labelIds |
Integer[] |
false |
客户标签 |
请求示例
请求URL
https://api-bj.clink.cn/crm/create_customer
&<公共请求参数>
RequestBody请求参数
{
"name":"张三",
"tel":[
"18888888888"
],
"level":0,
"shareType":0,
"share":null,
"sex":0,
"email":"zhangsan@xxx.com.cn",
"remark":null,
"address":"河北省沧州市",
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
],
"externalId":"abc1234",
"source":30,
"visitorIds":[""],
"labelIds":[1,2]
}
名称 | 类型 | 描述 |
---|---|---|
customer |
Object |
客户资料对象
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
客户资料id |
name |
String |
客户名称 |
tel |
String[] |
客户号码 |
level |
Integer |
客户登记,0:普通,1:VIP |
shareType |
Integer |
归属类型,0:全体共享、1:员工组共享、2:员工私有、3:无归属 |
share |
Integer |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
sex |
Integer |
客户性别,0:男、1:女 |
String |
邮箱 |
|
remark |
String |
备注 |
source |
Integer |
客户来源,0:呼叫中心, 1:在线咨询, 2:微信,3:人工添加,4:小程序,5:微博,6:电子邮件, 7:app端,8:企业微信,9:微信客服(独立版),10:第三方接入,15:百度营销,16:自定义渠道, 18:APP, 19:微信客服,21:企微客服,23: 飞书,24:座席助手,25:企微助手,30:接口创建 |
address |
String |
地址 |
customize |
Object[] |
该对象中,id为自定义字段id,value为对应的值 |
externalId |
String |
外部企业客户ID (第三方平台 ID) |
lastContactTime |
Date |
最后一次联系时间 |
lastContactType |
Integer |
最后一次联系类型,1:呼入,4:外呼 |
delete |
Integer |
删除标识,0:未删除、1:已删除 |
creatorType |
Integer |
创建人类型,2:openApi |
creatorId |
Integer |
创建人id,-1:openApi |
modifierType |
Integer |
更新人类型,2:openApi |
modifierId |
Integer |
更新人id,-1:openApi |
createTime |
Date |
创建时间 |
updateTime |
Date |
更新时间 |
visitorIds |
String[] |
访客ids |
creatorName |
String |
创建人名称 |
modifierName |
String |
更新人名称 |
customizeSearch |
String |
自定义字段查询条件 |
ibBridgedNumber |
Integer |
呼入接通次数 |
obBridgedNumber |
Integer |
呼出接通次数 |
obNumber |
Integer |
呼出次数 |
assignTime |
Date |
分配时间 |
operationLogs |
Object[] |
操作日志 |
ibNumber |
Integer |
呼入次数 |
retrieve |
Integer |
是否为回收客户 |
retrieveTime |
Date |
回收时间 |
queueWithoutAttribution |
Integer[] |
无归属授权员工组 |
返回示例
{
"id":12346,
"name":"张三",
"sex":0,
"tel":[
"18888888888"
],
"email":"zhangsan@xxx.com.cn",
"address":"河北省沧州市",
"level":0,
"shareType":0,
"share":null,
"remark":null,
"source":30,
"creatorType":2,
"creatorId":-1,
"modifierType":2,
"modifierId":-1,
"lastContactTime":null,
"lastContactType":null,
"delete":null,
"customize":[
{
"id":76797,
"value":"1"
}
],
"createTime":null,
"updateTime":null,
"visitorIds":null,
"creatorName":"",
"modifierName":"",
"customizeSearch":null,
"ibBridgedNumber":null,
"obBridgedNumber":null,
"obNumber":null,
"assignTime":null,
"operationLogs":null,
"externalId":"abc1234",
"ibNumber":null,
"retrieve":null,
"retrieveTime":null,
"queueWithoutAttribution":null
}
POST /crm/update_customer
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
id |
Integer |
false |
客户ID,不传则按visitorId来更新 |
visitorId |
String |
false |
访客ID |
name |
String |
后台配置 |
客户名称 |
tel |
String[] |
后台配置 |
客户号码 |
level |
Integer |
后台配置 |
客户等级,0:普通,1:VIP |
shareType |
Integer |
true |
归属类型,0:全体共享、1:员工组共享、2:员工私有、3:无归属 |
share |
String |
false |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
sex |
Integer |
后台配置 |
客户性别,0:男、1:女 |
String |
后台配置 |
邮箱 |
|
remark |
String |
后台配置 |
备注 |
address |
String |
后台配置 |
地址 |
renovate |
Integer |
false |
更新方式,0:更新,如果传空值不覆盖该空值所对应的字段不更新、 1:全量覆盖、默认为1 |
customize |
Object[] |
false |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
externalId |
String |
后台配置 |
外部企业客户ID (第三方平台 ID) |
labelIds |
Integer[] |
false |
客户标签 |
请求示例
请求URL
https://api-bj.clink.cn/crm/update_customer
&<公共请求参数>
RequestBody请求参数
{
"id":1234,
"visitorId": "1",
"name":"张三",
"tel":[
"18888888888"
],
"level":0,
"shareType":0,
"share":null,
"sex":0,
"email":"zhangsan@xxx.com.cn",
"remark":null,
"address":"河北省沧州市",
"renovate": 1,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
],
"externalId":"abc1234",
"labelIds":[1,2]
}
名称 | 类型 | 描述 |
---|---|---|
customer |
Object |
返回示例
{
"id":12346,
"name":"张三",
"sex":0,
"tel":[
"18888888888"
],
"email":"zhangsan@xxx.com.cn",
"address":"河北省沧州市",
"level":0,
"shareType":0,
"share":null,
"remark":null,
"source":30,
"creatorType":2,
"creatorId":-1,
"modifierType":2,
"modifierId":-1,
"lastContactTime":null,
"lastContactType":null,
"delete":null,
"customize":[
{
"id":76797,
"value":"1"
}
],
"createTime":null,
"updateTime":null,
"visitorIds":null,
"creatorName":"",
"modifierName":"",
"customizeSearch":null,
"ibBridgedNumber":null,
"obBridgedNumber":null,
"obNumber":null,
"assignTime":null,
"operationLogs":null,
"externalId":"abc1234",
"ibNumber":null,
"retrieve":null,
"retrieveTime":null,
"queueWithoutAttribution":null
}
POST /crm/update_customer_by_external_id
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
name |
String |
后台配置 |
客户名称 |
tel |
String[] |
后台配置 |
客户号码 |
level |
Integer |
后台配置 |
客户等级,0:普通、1:VIP |
shareType |
Integer |
true |
归属类型,0:全体共享、1:员工组共享、2:员工私有、3:无归属 |
share |
String |
false |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
sex |
Integer |
后台配置 |
客户性别,0:男、1女 |
String |
后台配置 |
邮箱 |
|
remark |
String |
后台配置 |
备注 |
address |
String |
后台配置 |
地址 |
renovate |
Integer |
false |
更新方式,0:更新,如果传空值不覆盖该空值所对应的字段不更新、 1:全量覆盖、默认为1 |
customize |
Object[] |
false |
该对象中,id为自定义字段id,value为对应的值 |
externalId |
String |
true |
外部企业客户ID(第三方平台 ID) |
请求示例
请求URL
https://api-bj.clink.cn/crm/update_customer_by_external_id
&<公共请求参数>
RequestBody请求参数
{
"id":1234,
"name":"张三",
"tel":[
"18888888888"
],
"level":0,
"shareType":0,
"share":null,
"sex":0,
"email":"zhangsan@xxx.com.cn",
"remark":null,
"address":"河北省沧州市",
"renovate": 0,
"customize":[
{
"id":440,
"value":"1"
}
],
"externalId":"123abc"
}
名称 | 类型 | 描述 |
---|---|---|
customer |
Object |
返回示例
{
"id":1234,
"name":"张三",
"tel":[
"18888888888"
],
"level":0,
"shareType":0,
"share":null,
"sex":0,
"email":"zhangsan@xxx.com.cn",
"remark":null,
"address":"河北省沧州市",
"customize":[
{
"id":440,
"value":"1"
}
],
"externalId":"123abc"
}
POST /crm/delete_customer
名称 |
类型 |
是否必需 |
描述 |
id |
Integer |
true |
客户 Id |
名称 |
类型 |
描述 |
id |
Integer |
客户 Id |
返回示例
{
"requestId":"5f058c02-14a4-43e9-821c-0ec7cbb90c1b",
"id":1234
}
POST /crm/query_customer
请求示例
请求URL
https://api-bj.clink.cn/crm/query_customer?<公共请求参数>
请求体:
{
"customerId": 1,
"visitorId": "1",
"tel": "18812345678"
}
名称 |
类型 |
是否必需 |
描述 |
customerId |
integer |
false |
客户资料id,不传则按visitorId来查询结果 |
visitorId |
String |
false |
访客ID,不传则按tel来查询结果 |
tel |
String |
false |
电话号码(非加密) |
名称 |
类型 |
描述 |
customer |
Object |
客户资料对象 |
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
客户资料id |
name |
String |
客户名称 |
sex |
String |
客户性别 |
tel |
String[] |
客户号码 |
String |
邮箱 |
|
address |
String |
地址 |
level |
String |
客户等级 |
shareType |
String |
归属类型,0:全体共享、1:员工组共享、2:员工私有、3:无归属 |
share |
String |
客户归属 |
remark |
String |
备注 |
source |
String |
客户来源 |
creatorType |
String |
创建人类型 |
creatorId |
Integer |
创建人id,-1:openApi |
modifierType |
String |
更新人类型 |
modifierId |
Integer |
更新人id,-1:openApi |
lastContactTime |
Date |
最后一次联系时间 |
lastContactType |
Integer |
最后一次联系类型,1:呼入,4:外呼 |
customize |
Object[] |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
createTime |
Date |
创建时间 |
updateTime |
Date |
更新时间 |
visitorIds |
String[] |
访客ids |
creatorName |
String |
创建人名称 |
modifierName |
String |
更新人名称 |
ibBridgedNumber |
Integer |
呼入接通次数 |
obBridgedNumber |
Integer |
呼出接通次数 |
obNumber |
Integer |
呼出次数 |
assignTime |
Date |
分配时间 |
externalId |
String |
外部企业客户ID (第三方平台 ID) |
ibNumber |
Integer |
呼入次数 |
retrieve |
Integer |
是否为回收客户 |
retrieveTime |
Date |
回收时间 |
queueWithoutAttribution |
Integer[] |
无归属授权员工组 |
phaseId |
Integer |
客户阶段id |
phaseReasonId |
Integer |
阶段原因id |
promoteSource |
String |
推广来源 |
repeatPromoteCount |
Integer |
重复推广次数 |
lastRepeatPromoteTime |
Date |
最近一次重复推广时间 |
labelIds |
Integer[] |
客户标签id |
enterpriseCustomerId |
Integer |
企业客户ID |
返回示例
{
"requestId": "2333ed6d-6b39-44c4-83ca-c7485cf47b20",
"customer": {
"id": 0,
"name": "",
"sex": "",
"tel": "",
"email": "",
"address": "",
"level": "",
"shareType": "",
"share": "",
"remark": "",
"source": "",
"creatorType": "",
"creatorId": -1,
"modifierType": "",
"modifierId": -1,
"lastContactTime": null,
"lastContactType": 1,
"customize": [{
"id": 0,
"name": "",
"value": ""
}],
"createTime": null,
"updateTime": null,
"visitorIds": [""],
"creatorName": "",
"modifierName": "",
"ibBridgedNumber": 0,
"obBridgedNumber": 0,
"obNumber": 0,
"assignTime": null,
"externalId": "",
"ibNumber": 0,
"retrieve": 0,
"retrieveTime": null,
"queueWithoutAttribution": [0],
"phaseId": 0,
"phaseReasonId": 0,
"promoteSource": null,
"repeatPromoteCount": 0,
"lastRepeatPromoteTime": null,
"labelIds": [1],
"enterpriseCustomerId": 123
}
}
POST /crm/list_customer_labels
名称 |
类型 |
是否必需 |
描述 |
name |
String |
false |
标签名称 |
名称 |
类型 |
描述 |
customerLabels |
Object |
标签分组及标签对象 |
名称 | 类型 | 描述 |
---|---|---|
labelGroupName |
String |
标签分组名称 |
customerLabelList |
Object[] |
分组下的标签对象数组 |
标签对象
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
标签id |
groupId |
Integer |
标签组ID |
name |
String |
标签名称 |
type |
Integer |
标签类型 1:手动标签 |
source |
Integer |
标签来源 1:客户标签 |
color |
String |
标签颜色 |
返回示例
{
"requestId": "xxx",
"customerLabels": [
{
"labelGroupName": "测试分组56",
"customerLabelList": [
{
"id": 76,
"groupId": 13,
"name": "5",
"type": 1,
"source": 1,
"color": "#EFEFEF"
},
{
"id": 158,
"groupId": 13,
"name": "敏感客户",
"type": 1,
"source": 1,
"color": "#FEE5E5"
},
{
"id": 228,
"groupId": 13,
"name": "ytwl1001",
"type": 1,
"source": 1,
"color": "#FEE5E5"
},
{
"id": 877,
"groupId": 13,
"name": "测试2",
"type": 1,
"source": 1,
"color": "#EFEFEF"
},
{
"id": 878,
"groupId": 13,
"name": "测试3",
"type": 1,
"source": 1,
"color": "#EFEFEF"
}
]
},
{
"labelGroupName": "测试分组7",
"customerLabelList": [
{
"id": 78,
"groupId": 15,
"name": "7",
"type": 1,
"source": 1,
"color": "#FAEBD1"
},
{
"id": 152,
"groupId": 15,
"name": "1",
"type": 1,
"source": 1,
"color": "#EFEFEF"
}
]
}
]
}
POST /crm/update_customer_relevancy
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
id |
Integer |
true |
客户ID |
visitorId |
String |
false |
访客ID,在修改visitorId关联关系时必传 |
enterpriseCustomerId |
Integer |
false |
企业客户ID,在更新关联的企业客户时必传 |
operationType |
Integer |
false |
更新方式,null或0:增加visitorId关联关系,1:解除visitorId关联关系,2:更新关联的企业客户 |
请求示例
请求URL
https://api-bj.clink.cn/crm/update_customer_relevancy
&<公共请求参数>
RequestBody请求参数
{
"id":1234,
"visitorId": "1",
"operationType":0
}
名称 | 类型 | 描述 |
---|---|---|
value |
Boolean |
更新是否成功,true:成功,false:失败 |
msg |
String |
失败时的错误信息 |
返回示例
{
"result": {
"value": true,
"msg": null
},
"requestId": "4ed8f07d-683e-49b6-8759-c9c3ad08da5e"
}
GET /crm/list_business_customize_field
名称 |
类型 |
描述 |
businessCustomizeParams |
Object[] |
可用作查询参数字段集合 |
返回示例
{
"requestId":"cdab1851-5426-44e5-8d5e-bb06c085cff1",
"businessCustomizeParams":[
{
"id":49,
"name":"客户归属"
},
{
"id":44,
"name":"客户名称"
},
{
"id":46,
"name":"电话"
},
{
"id":43,
"name":"邮箱"
},
{
"id":45,
"name":"性别"
},
{
"id":48,
"name":"等级"
},
{
"id":52,
"name":"修改人"
},
{
"id":51,
"name":"创建人"
}
]
}
POST /crm/list_business
名称 |
类型 |
是否必需 |
描述 |
businessSearchModel |
BusinessSearchModel |
true |
查询的实体对象 |
offset |
Integer |
false |
偏移量,范围 大于等于0。默认值为 0 |
limit |
Integer |
false |
查询条数,范围 10-100。默认值为 10 |
BusinessSearchModel实体对象详细参数说明
名称 |
类型 |
是否必需 |
描述 |
startTime |
Long(十位的时间戳) |
false |
业务记录创建开始时间。当startTime传值时,endTime必传 |
endTime |
Long(十位的时间戳) |
false |
业务记录创建结束时间。当endTime传值时,startTime必传 |
updateStartTime |
Long(十位的时间戳) |
false |
业务记录更新开始时间。当updateStartTime传值时,updateEndTime必传 |
updateEndTime |
Long(十位的时间戳) |
false |
业务记录更新结束时间。当updateEndTime传值时,updateStartTime必传 |
customerId |
Integer |
false |
客户ID |
callId |
String |
false |
通话ID |
chatId |
String |
false |
会话ID |
topic |
String |
false |
业务主题 |
source |
Integer |
false |
来源。 0: 呼叫中心,1: 在线客服-网页,2: 在线客服-微信,3: 人工添加,4: 在线客服-小程序, 5: 在线客服-微博,6: 电子邮件,7: app端,8: 在线客服-企业微信,9: 在线客服-微信客服(独立版), 10: 在线客服-第三方接入,11: 呼叫中心-呼入,12: 呼叫中心-外呼,13: 呼叫中心-webcall, 15: 在线客服-百度营销,16: 在线客服-自定义渠道,18: 在线客服-APP,19: 在线客服-微信客服, 21: 在线客服-企微客服,23: 在线客服-飞书,24:座席助手,25:企微助手,30:接口创建 |
customerTel |
String |
false |
客户号码 |
customerName |
String |
false |
客户名称 |
customize |
Map<String, String> |
false |
该对象中,key为自定义字段的id,value为对应的值 |
提示:“创建时间或更新时间可单独或组合查询,如均未传按照近6个月创建时间进行查询返回数据。”
请求示例
请求URL
https://api-bj.clink.cn/crm/list_business?offset=0&limit=10
&<公共请求参数>
请求体:
{
"startTime":1595952000,
"endTime":1596124800,
"updateStartTime":1595952000,
"updateEndTime":1596124800,
"source":30,
"customerId":1,
"callId":"",
"chatId":"",
"topic":"",
"customerTel":"",
"customerName":"",
"customize":{
"1": "",
"2": ""
}
}
名称 | 类型 | 描述 |
---|---|---|
businesses |
Object[] |
业务记录对象集合 |
名称 | 类型 | 描述 |
---|---|---|
topic |
String |
业务记录主题 |
creator |
String |
创建人 |
createTime |
Date |
创建时间 |
id |
Integer |
业务记录 Id |
callId |
String |
通话记录 Id |
customerId |
Integer |
客户Id |
customerTel |
String[] |
客户号码 |
customerName |
String |
客户名称 |
chatId |
String |
会话ID |
customize |
Object[] |
该对象中,id为自定义字段的id,value 为对应的值 |
提示:"totalCount"数据无实际意义,请参考: 4.4. 查询业务记录条数
返回示例
{
"pageNumber": 1,
"requestId": "a74b4f0c-e87d-4f73-8be7-6bb2529aa347",
"pageSize": 10,
"totalCount": 1,
"businesses": [
{
"creator": "创建人名称",
"createTime": 1596080545924,
"customerId": 61478,
"topic": "测试五级级联",
"id": 121298,
"callId": "medias_1-1652839922.10",
"customerTel": [
"客户号码"
],
"customize": [
{
"id": "17492",
"value": "id1的值"
},
{
"id": "17898",
"value": ""
},
{
"id": "17896",
"value": "北京,北京市,大兴区"
},
{
"id": "18067",
"value": "下拉类表121231231231231231231231231231231231231231231212312312312312321312"
},
{
"id": "18072",
"value": "null"
},
{
"id": "24663",
"value": "1,2,3"
},
{
"id": "25600",
"value": "null"
},
{
"id": "17897",
"value": "你不好"
},
{
"id": "17491",
"value": "null"
},
{
"id": "25868",
"value": "用车,出城,报备出城"
},
{
"id": "18066",
"value": "null"
},
{
"id": "27347",
"value": "11,2,33"
},
{
"id": "27875",
"value": "null"
}
],
"customerName": "客户名称"
}
]
}
GET /crm/get_business_detail
名称 |
类型 |
是否必需 |
描述 |
id |
Integer |
true |
业务记录 Id |
名称 |
类型 |
描述 |
id |
Integer |
业务记录 Id |
customerId |
Integer |
关联的客户资料 Id |
customerName |
String |
关联的客户名称 |
customerTel |
String[] |
客户号码 |
topic |
String |
业务主题 |
creatorId |
Integer |
创建人 Id |
creatorName |
String |
创建人名称 |
modifierId |
Integer |
修改人 Id |
modifierName |
String |
修改人名称 |
source |
Integer |
来源。 0: 呼叫中心,1: 在线客服-网页,2: 在线客服-微信,3: 人工添加,4: 在线客服-小程序,5: 在线客服-微博,6: 电子邮件,7: app端,8: 在线客服-企业微信,9: 在线客服-微信客服(独立版),10: 在线客服-第三方接入,11: 呼叫中心-呼入,12: 呼叫中心-外呼,13: 呼叫中心-webcall,15: 在线客服-百度营销,16: 在线客服-自定义渠道,18: 在线客服-APP,19: 在线客服-微信客服,21: 在线客服-企微客服,23: 在线客服-飞书,24:座席助手,25:企微助手,30:接口创建 |
customize |
Object[] |
自定义字段 |
createTime |
Date |
创建时间 |
updateTime |
Date |
更新时间 |
callId |
String |
通话记录 Id |
chatId |
String |
会话ID |
operationLogs |
BusinessOperationLogModel[] |
业务记录修改日志业务记录操作日志字段 |
名称 |
类型 |
描述 |
operatorName |
String |
操作人名称 |
operatorId |
Integer |
操作人 Id |
operationType |
Integer |
操作类型。1: 创建,2: 修改。 |
fieldName |
String |
字段名 |
oldValue |
String |
自定义字段旧值 |
newValue |
String |
自定义字段新值 |
avatar |
String |
操作人头像 |
createTime |
Date |
创建时间 |
名称 |
类型 |
描述 |
id |
Integer |
自定义字段 Id |
name |
String |
自定义字段名称 |
type |
Integer |
自定义字段类型。1: 单行文本,2: 数值,3: 邮件,4: IP地址,5: 多行文本,6: 下拉框, 7: 自定义级联,8: 地区级联,9: 单选框,10: 复选框,11: 日期时间,12: 日期,13: 时间,17:下拉多选。 |
value |
String |
自定义字段值 |
返回示例
{
"requestId":"4ed8f07d-683e-49b6-8759-c9c3ad08da5e",
"businessDetail":[
{
"id":342,
"callId":"342",
"customerId": 123,
"customerName":"客户名称",
"topic":"业务记录主题",
"customerTel":["175****8887","123124124"],
"creatorId":111,
"creatorName":"创建人",
"modifierId":111,
"modifierName":"修改人",
"source":3,
"customize":[
{
"id":43939,
"name":"测试单行文本",
"type":1,
"value":"11"
},
{
"id":43940,
"name":"下拉框",
"type":6,
"value":[{"name":"1","selected":0},{"name":"2","selected":0}]
}
],
"createTime":"2020-08-20T11:19:15.249+0800",
"updateTime":"2020-08-20T11:19:15.249+0800",
"operationLogs":[
{
"operatorName":"sli(8358)",
"operatorId": 111,
"avatar":"头像地址",
"createTime":"2020-09-04T18:36:34.190+0800",
"operationType":1,
"fieldName":"字段名称",
"oldValue":"旧值",
"newValue":"新值"
}
]
}
]
}
POST /crm/list_business_count
名称 |
类型 |
是否必需 |
描述 |
businessSearchModel |
BusinessSearchModel |
true |
查询的实体对象 |
BusinessSearchModel实体对象详细参数说明
名称 |
类型 |
是否必需 |
描述 |
startTime |
Long(十位的时间戳) |
false |
业务记录创建开始时间。当startTime传值时,endTime必传 |
endTime |
Long(十位的时间戳) |
false |
业务记录创建结束时间。当endTime传值时,startTime必传 |
updateStartTime |
Long(十位的时间戳) |
false |
业务记录更新开始时间。当updateStartTime传值时,updateEndTime必传 |
updateEndTime |
Long(十位的时间戳) |
false |
业务记录更新结束时间。当updateEndTime传值时,updateStartTime必传 |
customerId |
Integer |
false |
客户ID |
callId |
String |
false |
通话ID |
chatId |
String |
false |
会话ID |
source |
Integer |
false |
来源。 0: 呼叫中心,1: 在线客服-网页,2: 在线客服-微信,3: 人工添加,4: 在线客服-小程序, 5: 在线客服-微博,6: 电子邮件,7: app端,8: 在线客服-企业微信,9: 在线客服-微信客服(独立版), 10: 在线客服-第三方接入,11: 呼叫中心-呼入,12: 呼叫中心-外呼,13: 呼叫中心-webcall, 15: 在线客服-百度营销,16: 在线客服-自定义渠道,18: 在线客服-APP,19: 在线客服-微信客服, 21: 在线客服-企微客服,23: 在线客服-飞书,24:座席助手,25:企微助手,30:接口创建 |
customerTel |
String |
false |
客户号码 |
customerName |
String |
false |
客户名称 |
customize |
Map<String, String> |
false |
该对象中,key为自定义字段的id,value为对应的值 |
提示:“创建时间或更新时间可单独或组合查询,如均未传按照近6个月创建时间进行查询返回数据。”
请求示例
请求URL
https://api-bj.clink.cn/crm/list_business_count
&<公共请求参数>
请求体:
{
"startTime":1595952000,
"endTime":1596124800,
"updateStartTime":1595952000,
"updateEndTime":1596124800,
"customerId":1,
"callId":"",
"chatId":"",
"source":30,
"customerTel":"",
"customerName":"",
"customize":{
"1": "",
"2": ""
}
}
名称 | 类型 | 描述 |
---|---|---|
count |
Integer |
总条数 |
返回示例
{
"requestId":"4ed8f07d-683e-49b6-8759-c9c3ad08da5e",
"count": 1
}
POST /crm/create_business
名称 |
类型 |
是否必需 |
描述 |
customerId |
Integer |
false |
客户ID, customerId/chatId/callId 必填其一 |
topic |
String |
false |
业务主题 |
source |
Integer |
false |
来源。24:座席助手,30:接口创建 。默认接口创建 |
customize |
Object[] |
false |
该数组对象中,name为自定义字段名称,value 为对应的值 |
chatId |
String |
false |
在线会话ID, customerId/chatId/callId 必填其一 |
chatStartTime |
Long |
false |
会话添加开始时间(用于确定会话数据的索引) |
callId |
String |
false |
通话记录ID, customerId/chatId/callId 必填其一 |
callUniqueId |
String |
false |
从通话记录ID |
chatUniqueId |
String |
false |
在线从会话ID |
请求示例
请求URL
https://api-bj.clink.cn/crm/create_business
&<公共请求参数>
请求体:
{
"customerId": 0,
"topic": "",
"source": 30,
"customize": [
{
"name": "",
"value": ""
}
],
"chatId": "",
"chatStartTime": 0,
"callId": "",
"callUniqueId": "",
"chatUniqueId": ""
}
名称 | 类型 | 描述 |
---|---|---|
business |
object |
业务记录 |
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
业务记录ID |
customerId |
Integer |
客户ID |
topic |
String |
业务主题 |
creatorType |
Integer |
创建人类型。2:openApi |
creatorCno |
String |
创建人工号。-1:openApi |
creator |
String |
创建人 |
modifierCno |
String |
修改人工号 |
modifier |
String |
修改人 |
modifierType |
Integer |
修改人类型 |
source |
Integer |
来源。24:座席助手,30:接口创建 |
customize |
String |
自定义字段 |
createTime |
Date |
记录创建时间 |
updateTime |
Date |
记录修改时间 |
chatId |
String |
在线会话ID |
chatStartTime |
Long |
会话添加开始时间(用于确定会话数据的索引) |
callId |
String |
通话记录ID |
callUniqueId |
String |
从通话记录ID |
chatUniqueId |
String |
在线从会话ID |
名称 |
类型 |
描述 |
id |
Integer |
自定义字段 Id |
name |
String |
自定义字段名称 |
type |
Integer |
自定义字段类型。1: 单行文本,2: 数值,3: 邮件,4: IP地址,5: 多行文本,6: 下拉框, 7: 自定义级联,8: 地区级联,9: 单选框,10: 复选框,11: 日期时间,12: 日期,13: 时间,17:下拉多选。 |
value |
String |
自定义字段值 |
返回示例
{
"requestId":"4ed8f07d-683e-49b6-8759-c9c3ad08da5e",
"business": {
"id": 0,
"customerId": 0,
"topic": "",
"creatorType": 0,
"creatorCno": "",
"creator": "",
"modifierCno": "",
"modifier": "",
"modifierType": 0,
"source": 30,
"customize": "[{\"id\":158571,\"name\":\"备注\",\"value\":\"这是一条备注\",\"type\":1,\"encryptValue\":null}]",
"createTime": null,
"updateTime": null,
"chatId": "",
"chatStartTime": 0,
"callId": "",
"callUniqueId": "",
"chatUniqueId": ""
}
}
GET /crm/list_business_field
名称 | 类型 | 描述 |
---|---|---|
businessFields |
Object[] |
业务记录自定义属性字段。 |
名称 | 类型 | 描述 |
---|---|---|
id |
integer |
自定义字段的id |
key |
string |
对应的系统字段的字段名 |
name |
string |
字段值 |
type |
integer |
1:单行文本-不限制,2:单行文本-数值,3:单行文本-邮箱,4:单行文本-IP地址,5:多行文本,6:下拉列表,7:自定义级联,8:地区级联 9:单选框,10:复选框,11:日期时间,12:日期,13:时间,14:附件,17:下拉多选 |
defaults |
integer |
是否为系统默认字段,0:否,1是 |
property |
String |
对应不同的类型的字段中的值具体见: [property字段说明] |
priority |
Integer |
优先级,决定展示顺序 |
required |
Integer |
是否必填,0:否,1:是 |
clientReadonly |
Integer |
普通座席只读,0:否,1:是 |
clientHidden |
Integer |
普通座席隐藏,0:否,1:是 |
hidden |
Integer |
是否启用,0:是,1: 否 |
property字段说明
下拉列表的property
[
{
"name":"选项1",
"selected":1
}
]
自定义级联和地区级联的property
[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"大兴区",
"selected":1
},
{
"title":"朝阳区",
"selected":0
}
]
}
]
},
{
"title":"河北省",
"selected":0,
"options":[
{
"title":"石家庄",
"selected":1
},
{
"title":"邢台",
"selected":0
}
]
}
]
单选框和复选框的property
[
{
"name":"选择1",
"selected":0
},
{
"name":"选择2",
"selected":1
}
]
返回示例
{
"requestId":"963e99e3-5a49-4562-a16e-38b9f981d4fe",
"businessFields":[
{
"id":440,
"key":null,
"name":"测试下拉列表",
"type":6,
"defaults":0,
"property":[{"name":"1","selected":1},{"name":"2","selected":0}],
"priority":18,
"required":1,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":9662,
"key":null,
"name":"测试复选框123",
"type":10,
"defaults":0,
"property":[{"name":"并行节点1","selected":0}],
"priority":38,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13450,
"key":null,
"name":"这是一个列表",
"type":6,
"defaults":0,
"property":[{"name":"你好啊啊","selected":1},{"name":"你好啊哈哈哈","selected":0}],
"priority":44,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13451,
"key":null,
"name":"单选123",
"type":9,
"defaults":0,
"property":[{"name":"13123","selected":1},{"name":"23123","selected":0}],
"priority":45,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13452,
"key":null,
"name":"日期时间字段",
"type":11,
"defaults":0,
"property":null,
"priority":46,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13453,
"key":null,
"name":"日期字段",
"type":12,
"defaults":0,
"property":null,
"priority":47,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13454,
"key":null,
"name":"时间字段",
"type":13,
"defaults":0,
"property":null,
"priority":48,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13455,
"key":null,
"name":"自定义级联",
"type":7,
"defaults":0,
"property":[{"title":"你好","options":[{"title":"你好啊","options":[{"title":"你好可爱啊"}]}]}],
"priority":49,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
},
{
"id":13456,
"key":null,
"name":"你好",
"type":8,
"defaults":0,
"property":[{"title":"北京","options":[{"title":"北京市","options":[{"title":"东城区"}]}]}],
"priority":50,
"required":0,
"clientReadonly":0,
"clientHidden":0,
"hidden":0
}
]
}
POST /crm/query_group_customer
请求示例
请求URL
https://api-bj.clink.cn/crm/query_group_customer?<公共请求参数>
请求体:
{
"customerId": 1,
"visitorId": "1"
}
名称 |
类型 |
是否必需 |
描述 |
customerId |
integer |
false |
客户资料id,不传则按visitorId来查询结果 |
visitorId |
String |
false |
访客ID,不传则按tel来查询结果 |
名称 |
类型 |
描述 |
customer |
Object |
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
客户资料id |
name |
String |
客户名称 |
visitorIds |
String[] |
访客ids |
customize |
Object[] |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
labelIds |
Integer[] |
客户标签id |
modifierType |
Integer |
更新人类型 |
modifierId |
Integer |
更新人id,-1:openApi |
modifierName |
String |
更新人名称 |
updateTime |
Date |
更新时间 |
createTime |
Date |
创建时间 |
返回示例
{
"requestId": "2333ed6d-6b39-44c4-83ca-c7485cf47b20",
"customer": {
"id": 1,
"name": "demo",
"visitorIds": ["123"],
"customize": [{
"id": 0,
"name": "测试字段",
"value": "123"
}],
"labelIds": [1],
"modifierType": 2,
"modifierId": -1,
"modifierName": "",
"updateTime": 1721357901812,
"createTime": 1720519017265
}
}
POST /crm/update_group_customer
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
renovate |
Integer |
false |
更新方式,0:更新,如果传空值不覆盖该空值所对应的字段不更新、 1:全量覆盖、默认为1 |
id |
Integer |
false |
客户ID,不传则按visitorId来更新 |
visitorId |
String |
false |
访客ID |
name |
String |
后台配置 |
客户名称 |
customize |
Object[] |
false |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
labelIds |
Integer[] |
false |
客户标签 |
请求示例
请求URL
https://api-bj.clink.cn/crm/update_group_customer&<公共请求参数>
RequestBody请求参数
{
"renovate": 1,
"id":1234,
"visitorId": "1",
"name":"张三",
"customize":[
{
"id":440,
"name":"测试字段",
"value":"1"
}
],
"labelIds":[1,2]
}
名称 | 类型 | 描述 |
---|---|---|
customer |
Object |
返回示例
{
"id": 12346,
"name": "张三",
"modifierType": 2,
"modifierId": -1,
"customize": [
{
"id":76797,
"value":"1"
}
],
"createTime": 1721357901812,
"updateTime": 1720519017265,
"visitorIds": ["123"],
"modifierName": "第三方用户(OpenAPI)",
"labelIds": [1]
}
GET /crm/list_enterprise_customer_field
名称 | 类型 | 描述 |
---|---|---|
id |
integer |
自定义字段的id |
key |
string |
对应的系统字段的字段名 |
name |
string |
字段值 |
type |
integer |
1:单行文本-不限制,2:单行文本-数值,3:单行文本-邮箱,4:单行文本-IP地址,5:多行文本,6:下拉列表,7:自定义级联,8:地区级联 9:单选框,10:复选框,11:日期时间,12:日期,13:时间,18:外部拓展字段,100:手机号码,101:身份证号,102:银行卡号 |
defaults |
integer |
是否为系统默认字段,0:否,1是 |
property |
String |
对应不同的类型的字段中的值具体见: [property字段说明] |
priority |
Integer |
优先级,决定展示顺序 |
required |
Integer |
是否必填,0:否,1:是 |
unique |
Integer |
是否唯一,0:否,1:是 |
clientReadonly |
Integer |
普通座席只读,0:否,1:是 |
clientHidden |
Integer |
普通座席隐藏,0:否,1:是 |
searchDisplay |
Integer |
查询是否展示,0:否,1:是 |
hidden |
Integer |
是否启用,0:是,1: 否 |
property字段说明
下拉列表的property
[
{
"name":"选项1",
"selected":1
}
]
自定义级联和地区级联的property
[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"北京市",
"selected":1,
"options":[
{
"title":"大兴区",
"selected":1
},
{
"title":"朝阳区",
"selected":0
}
]
}
]
},
{
"title":"河北省",
"selected":0,
"options":[
{
"title":"石家庄",
"selected":1
},
{
"title":"邢台",
"selected":0
}
]
}
]
单选框和复选框的property
[
{
"name":"选择1",
"selected":0
},
{
"name":"选择2",
"selected":1
}
]
返回示例
{
"requestId":"963e99e3-5a49-4562-a16e-38b9f981d4fe",
"customerFields":[
{
"id":440,
"key":null,
"name":"测试下拉列表",
"type":6,
"defaults":0,
"property":[{"name":"1","selected":1},{"name":"2","selected":0}],
"priority":18,
"required":1,
"unique":1,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":1,
"hidden":0
},
{
"id":9662,
"key":null,
"name":"测试复选框",
"type":10,
"defaults":0,
"property":[{"name":"并行节点1","selected":0}],
"priority":38,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":1,
"hidden":0
},
{
"id":13451,
"key":null,
"name":"单选",
"type":9,
"defaults":0,
"property":[{"name":"123","selected":1},{"name":"456","selected":0}],
"priority":45,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13452,
"key":null,
"name":"日期时间字段",
"type":11,
"defaults":0,
"property":null,
"priority":46,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13453,
"key":null,
"name":"日期字段",
"type":12,
"defaults":0,
"property":null,
"priority":47,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13454,
"key":null,
"name":"时间字段",
"type":13,
"defaults":0,
"property":null,
"priority":48,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13455,
"key":null,
"name":"自定义级联",
"type":7,
"defaults":0,
"property":[{"title":"你好","options":[{"title":"你好啊","options":[{"title":"你好可爱啊"}]}]}],
"priority":49,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
},
{
"id":13456,
"key":null,
"name":"地区级联",
"type":8,
"defaults":0,
"property":[{"title":"北京","options":[{"title":"北京市","options":[{"title":"东城区"}]}]}],
"priority":50,
"required":0,
"unique":0,
"clientReadonly":0,
"clientHidden":0,
"searchDisplay":0,
"hidden":0
}
]
}
POST /crm/create_enterprise_customer
名称 |
类型 |
是否必需 |
描述 |
name |
String |
后台配置 |
企业客户名称 |
level |
String |
后台配置 |
客户等级 |
shareType |
Integer |
true |
归属类型,0:全体共享、1:员工组共享、2:员工私有 |
shareNo |
String |
false |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
customize |
Object[] |
true |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
source |
Integer |
false |
来源。30:接口创建。默认接口创建 |
请求示例
请求URL
https://api-bj.clink.cn/crm/create_enterprise_customer
&<公共请求参数>
RequestBody请求参数
{
"name":"测试企业",
"level":"普通",
"shareType":0,
"shareNo":null,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
]
}
名称 | 类型 | 描述 |
---|---|---|
enterpriseCustomer |
Object |
企业客户资料对象
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
企业客户id |
name |
String |
企业客户名称 |
level |
String |
客户等级 |
shareType |
Integer |
归属类型,0:全体共享、1:员工组共享、2:员工私有 |
share |
Integer |
客户归属,当为员工组共享时为员工组id,当为员工私有时为员工id,员工组共享或者员工私有时必传 |
source |
Integer |
客户来源,0:呼叫中心, 1:在线咨询, 2:微信,3:人工添加,4:小程序,5:微博,6:电子邮件, 7:app端,8:企业微信,9:微信客服(独立版),10:第三方接入,15:百度营销,16:自定义渠道, 18:APP, 19:微信客服,21:企微客服,23: 飞书,24:座席助手,25:企微助手,30:接口创建 |
customize |
Object[] |
该对象中,id为自定义字段id,value为对应的值 |
creatorId |
Integer |
创建人id,-2:openApi |
modifierId |
Integer |
更新人id,-2:openApi |
createTime |
Date |
创建时间 |
updateTime |
Date |
更新时间 |
返回示例
{
"id":123,
"name":"测试企业",
"level":"普通",
"shareType":0,
"shareNo":null,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
],
"source":30,
"creatorId":-2,
"modifierId":-2,
"createTime":1717663550430,
"updateTime":1717663550430
}
POST /crm/update_enterprise_customer
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
renovate |
Integer |
false |
更新方式,0:更新,如果传空值不覆盖,该空值所对应的字段不更新、 1:全量覆盖、默认为1 |
id |
Integer |
false |
企业客户ID,不传则按nameSearch来更新 |
nameSearch |
String |
false |
企业客户名称,查询用 |
name |
String |
后台配置 |
企业客户名称 |
level |
String |
后台配置 |
客户等级 |
shareType |
Integer |
false |
归属类型,0:全体共享、1:员工组共享、2:员工私有 |
shareNo |
String |
false |
客户归属,当为员工组共享时为员工组号,当为员工私有时为员工工号,员工组共享或者员工私有时必传 |
customize |
Object[] |
true |
该对象中,id为自定义字段id, name为自定义字段名称, value为自定义字段值 |
请求示例
请求URL
https://api-bj.clink.cn/crm/update_enterprise_customer
&<公共请求参数>
RequestBody请求参数
{
"id":1234,
"name":"测试企业",
"level":"普通",
"shareType":0,
"shareNo":null,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
]
}
名称 | 类型 | 描述 |
---|---|---|
enterpriseCustomer |
Object |
返回示例
{
"id":123,
"name":"测试企业",
"level":"普通",
"shareType":0,
"shareNo":null,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
],
"source":30,
"creatorId":-2,
"modifierId":-2,
"createTime":1717663550430,
"updateTime":1717663550430
}
POST /crm/delete_enterprise_customer
请求示例
https://api-bj.clink.cn/crm/delete_enterprise_customer
&<公共请求参数>
RequestBody请求参数
{
"id":123
}
名称 |
类型 |
是否必需 |
描述 |
id |
Integer |
true |
客户 Id |
名称 |
类型 |
描述 |
id |
Integer |
客户 Id |
返回示例
{
"requestId":"5f058c02-14a4-43e9-821c-0ec7cbb90c1b",
"id":1234
}
POST /crm/query_enterprise_customer
名称 |
类型 |
是否必需 |
描述 |
id |
Integer |
false |
企业客户id,不传则按name来查询结果 |
name |
String |
false |
企业名称 |
名称 |
类型 |
描述 |
enterpriseCustomer |
Object |
客户资料对象 |
名称 | 类型 | 描述 |
---|---|---|
id |
Integer |
企业客户id |
name |
String |
企业客户名称 |
level |
String |
客户等级 |
shareType |
Integer |
归属类型,0:全体共享、1:员工组共享、2:员工私有 |
share |
Integer |
客户归属,当为员工组共享时为员工组id,当为员工私有时为员工id,员工组共享或者员工私有时必传 |
source |
Integer |
客户来源,0:呼叫中心, 1:在线咨询, 2:微信,3:人工添加,4:小程序,5:微博,6:电子邮件, 7:app端,8:企业微信,9:微信客服(独立版),10:第三方接入,15:百度营销,16:自定义渠道, 18:APP, 19:微信客服,21:企微客服,23: 飞书,24:座席助手,25:企微助手,30:接口创建 |
customize |
Object[] |
该对象中,id为自定义字段id,value为对应的值 |
creatorId |
Integer |
创建人id,-2:openApi |
modifierId |
Integer |
更新人id,-2:openApi |
createTime |
Date |
创建时间 |
updateTime |
Date |
更新时间 |
creatorName |
String |
创建人名称 |
modifierName |
String |
更新人名称 |
shareName |
String |
归属名称 |
sourceName |
String |
来源名称 |
返回示例
{
"requestId": "2333ed6d-6b39-44c4-83ca-c7485cf47b20",
"enterpriseCustomer": {
"id":123,
"name":"测试企业",
"level":"普通",
"shareType":0,
"shareNo":null,
"customize":[
{
"id":440,
"name":"",
"value":"1"
}
],
"source":30,
"creatorId":-2,
"modifierId":-2,
"createTime":1720667801331,
"updateTime":1720667801331,
"creatorName":"第三方用户(OpenAPI)",
"modifierName":"测试员工(8081)",
"shareName":"员工私有:测试员工(8088)",
"sourceName":"接口"
}
}