CRM客户管理接口

1、添加客户

接口说明:使用此接口可以进行客户资料的添加,请求参数可以参考下面的字段及示例。如需进行修改删除,请务必保留客户创建成功后提供的_id。如需有自定义字段,可先调用,查询客户字段配置列表接口,去获取自定义字段。

1.1、URL

POST /openapi/crm/add

1.2、请求参数

字段名称类型是否必填备注
customerName客户名字StringY
assignTime归属时间StringN
createMethod创建方式StringN
mobile手机List<PhoneProperty>N
email邮箱List<EmailProperty>N
qqqqList<QqProperty>N
wechat微信List<WechatProperty>N
visitorId访客进线idStringN网页渠道访客进线时所传的visitorId,若能对应上,那么访客对话将会自动匹配上客户资料
PhoneProperty、EmailProperty、QqProperty、WechatProperty
字段名称类型
valueString
memo备注String

1.3、返回参数

data具体内容与请求参数类型一致。

1.4、请求示例

{ "customerName": "test", "mobile": [ { "value": "333222111", "memo": "王哈" } ], "customerSource": [ "试用申请" ], "owner": "8310", "assignTime": "2024-11-14 09:46:17" }

1.5、响应示例

{ "success": true, "message": "200 ok!", "code": "200", "data": { "accountId": "1090", "createTime": "2023-06-26 23:18:43", "createMethod": "", "updateAgent": "openApi", "updateTime": "2023-06-26 23:18:43", "_id": "685775343058800640", "customerName": "testCustomer", "createAgent": "openApi" } }

2、修改客户

接口说明:使用此接口可以进行客户资料的修改,需要用添加客户资料生成的_id进行修改,请求参数可以参考下面的字段及示例。

2.1、URL

POST /openapi/crm/update

2.2、请求参数

参考1.2的请求及下列示例。_id必传,修改客户资料需要用到

2.3、请求示例

curl --location 'http://47.99.32.215:8081/openapi/crm/update' \ --header 'appid: 1090' \ --header 'nonce: 123456' \ --header 'timestamp: 1687792901' \ --header 'signature: osiJIMEZRFzQPJDH/3hsYe3BGhk/0aouXGyhX2Af2mc=' \ --header 'Content-Type: application/json' \ --data '{ "_id": "685775898716000256", "customerName": "testCustomer" }' { "success": true, "message": "200 ok!", "code": "200", "data": { "accountId": "1090", "createTime": "2023-06-26 23:20:56", "createMethod": "", "updateAgent": "openApi", "updateTime": "2023-06-26 23:21:56", "_id": "685775898716000256", "customerName": "testCustomer", "createAgent": "openApi" } }

3、查询客户列表

接口说明:可以查询当前账号下所有客户列表。

3.1、URL

POST /openapi/crm/list

3.2、请求示例

{
    "search":[{"operator":"eq","value":["13231307283"],"field":"mobile"}]
}
curl --location 'http: //47.99.32.215:8081/openapi/crm/list' \ --header 'appid: 1090' \ --header 'nonce: 123456' \ --header 'timestamp: 1687792454' \ --header 'signature: 0gJctlWNzEIPu/A17MI //xV/5WwTcqp9c1cEkXwL/1Q=' \ --header 'Content-Type: application/json' \ --data '{ "limit": 1, "page": 1, "search": [ { "field": "openSeaIds", "value": [], "operator": "empty" } ] }' { "success": true, "message": "200 ok!", "code": "200", "data": { "list": [ { "owner": "662821403012902912", "firstAssignTime": "2023-06-26 22:57:30", "accountId": "1090", "createTime": "2023-06-26 22:57:30", "createMethod": "API", "firstOwner": "662821403012902912", "updateAgent": "openApi", "updateTime": "2023-06-26 22:57:30", "_id": "685770000643772416", "assignTime": "2023-06-26 22:57:30", "customerName": "testCustomer", "createAgent": "openApi" } ], "count": 20 } }

4、根据id查询客户

接口说明:可用此接口查询单独某个客户在系统的详细信息。

4.1、URL

GET /openapi/crm/{id}

4.2、请求示例

curl --location 'http://47.99.32.215:8081/openapi/crm/findById/685736803322032128' \ --header 'appid: 1090' \ --header 'nonce: 123456' \ --header 'timestamp: 1687792454' \ --header 'signature: 0gJctlWNzEIPu/A17MI//xV/5WwTcqp9c1cEkXwL/1Q=' \ --header 'Content-Type: application/json' \ --data '{}'

5、根据id删除客户

接口说明:删除客户资料接口,提供id即可进行删除。

5.1、URL

POST /openapi/crm/delete

5.2、请求示例

curl --location 'http://47.99.32.215:8081/openapi/crm/delete' \ --header 'appid: 1090' \ --header 'nonce: 123456' \ --header 'timestamp: 1687792102' \ --header 'signature: k/0nGQXTld3Te5wCIHtWFBYaZZdJOm/uesKTU4E1AjM=' \ --header 'Content-Type: application/json' \ --data '{ "id": "685736803368169472" }' { "success": true, "message": "200 ok!", "code": "200", "data": null }

6、查询客户字段配置列表

接口:查询账号下的字段信息,主要是自定义字段的类型。方便进行新增。

6.1、URL

POST /openapi/crm/config/field/list

6.2、请求参数

字段名称类型
name字段名称String
category字段分类List<String>
type字段类型List<String>
enabled停用/启用状态Boolean
editable是否可编辑(自动生成的字段不可编辑)Boolean

6.3、请求示例

curl --location 'http: //47.99.32.215:8081/openapi/crm/config/field/list' \ --header 'appid: 1090' \ --header 'nonce: 123456' \ --header 'timestamp: 1687792102' \ --header 'signature: k/0nGQXTld3Te5wCIHtWFBYaZZdJOm/uesKTU4E1AjM=' \ --header 'Content-Type: application/json' \ --data '{}' { "success": true, "message": "200 ok!", "code": "200", "data": [ { "accountId": "1090", "glFieldId": "text_6ts9_1687316347239", "field": "text_6ts9_1687316347239", "name": "详细地址", "param": "text_6ts9_1687316347239", "type": "text", "status": 1, "searchable": false, "oplog": false, "choices": null, "options": null, "createTime": "2023-06-21 11:02:18", "updateTime": "2023-06-21 11:02:18", "createAgent": "662772464553308160", "updateAgent": "662772464553308160", "scenes": null, "sort": 42, "isSystem": false, "required": false } ] }

6.4、返回参数

data为List<CustomerFieldVO>CustomerFieldVO:
字段名称类型
accountId账户idString
glFieldId全局字段idString
field字段idString
name字段名称String
param字段参数String
type字段类型String
status状态, 0: 停用; 1: 启用; -1: 删除int
searchable是否可查询Boolean
oplog是否记录操作日志Boolean
choices下拉选项List<ChoicesDubbo>
options级联选项CascadeOptionsDubbo
scenes应用场景List<String>
sort排序int
isSystem是否是预置字段Boolean
required是否必填Boolean
ChoicesDubbo
字段名称类型
key选项keyString
value选项valueString
isDefault是否为默认值Boolean
CascadeOptionsDubbo
字段名称类型
level层级int
fillLevel几级必填int
children次级选项列表List<ChildOptionDubbo>
ChildOptionDubbo
字段名称类型
key选项keyString
value选项valueString
children次级选项List<ChildOptionDubbo>

6.5、返回示例

{ "success": true, "message": "string", "code": "string", "data": [ { "accountId": "string", "glFieldId": "string", "field": "string", "name": "string", "param": "string", "type": "string", "status": 0, "searchable": true, "oplog": true, "choices": [ { "key": "string", "value": "string", "isDefault": true } ], "options": { "level": 0, "fillLevel": 0, "children": [ { "key": "string", "value": "string" } ] }, "createTime": "string", "updateTime": "string", "createAgent": "string", "updateAgent": "string", "scenes": [ "string" ], "sort": 0, "isSystem": true, "required": true } ] }
2024-11-26