新建客户
服务描述
本接口,可用于企业自行创建自己的客户,也可以用于将原系统的客户导入得助的系统
开发须知
调用本接口前,请先获取appId
服务地址
POST https://{您的专属域名}/basic/openapi/v1/customer
请求参数
| 参数 |
位置 |
类型 |
是否必填 |
说明 |
| appId |
header |
String |
Y |
应用ID |
| timestamp |
header |
String |
Y |
时间戳,毫秒 |
| sign |
header |
String |
Y |
签名 |
| Content-Type |
header |
String |
Y |
application/json |
|
Body |
CustomerDTO |
Y |
客户信息,json |
CustomerDTO
| 参数 |
类型 |
是否必填 |
说明 |
| customerDictList |
array< CustomerDictDTO > |
N |
自定义字段列表 |
| customerGroupId |
String |
N |
公司ID |
| customerGroupName |
String |
N |
公司名称 |
| name |
String |
N |
客户名称 |
| email |
String |
N |
客户邮箱 |
| phone |
String |
N |
客户手机号码 |
| telephone |
String |
N |
联系电话(座机号) |
| externalId |
String |
N |
外部系统用户ID |
| desc |
String |
N |
描述 |
| tag |
String |
N |
标签,多个之间用英文逗号分隔 |
CustomerDictDTO
| 参数 |
类型 |
是否必填 |
说明 |
| dictCode |
String |
Y |
自定义字段code |
| remark |
String |
N |
备注 |
| value |
String |
Y |
自定义字段值 |
Body数据示例:
{
"customerDictList" : [ {
"dictCode" : "1",
"remark" : "1",
"value" : "1"
} ],
"customerGroupId" : "1",
"customerGroupName" : "1",
"desc" : "1",
"email" : "1",
"externalId" : "1",
"name" : "1",
"phone" : "1",
"principalEmail" : "1",
"tag" : "1",
"telephone" : "1"
}
返回结果
CustomerDetail
| 参数 |
说明 |
类型 |
是否必填 |
| customer |
客户信息 |
BasicCustomerIdentity |
N |
| customerDictList |
客户属性列表 |
< CustomerDictDTO > array |
N |
| customerGroupName |
公司名称 |
string |
N |
| isCustomerGroupDelete |
公司是否删除 |
boolean |
N |
| productName |
渠道名称 |
string |
N |
| staffName |
专属客服名称 |
string |
N |
BasicCustomerIdentity
| 名称 |
说明 |
类型 |
是否必填 |
| anonymous |
是否匿名(0-匿名,1-非匿名) |
integer (int32) |
N |
| blackTime |
拉黑时间 |
string (date-time) |
N |
| blacklist |
是否黑名单(0-否,1-是) |
integer (int32) |
N |
| cancelReason |
作废原因 |
string |
N |
| cancelRemark |
作废备注 |
string |
N |
| cancelTime |
作废时间 |
string (date-time) |
N |
| createTime |
创建时间 |
string (date-time) |
N |
| customerClass |
客户等级 |
integer (int32) |
N |
| customerGroupId |
公司ID |
string |
N |
| customerId |
客户ID |
string |
N |
| customerStatus |
客户状态 |
integer (int32) |
N |
| customerType |
客户类型 |
integer (int32) |
N |
| deleteTime |
删除时间 |
string (date-time) |
N |
| deleted |
是否删除 |
boolean |
N |
| desc |
备注 |
string |
N |
| email |
邮箱 |
string |
N |
| externalId |
外部系统用户ID |
string |
N |
| id |
数据库ID |
integer (int64) |
N |
| isCancel |
是否作废 |
boolean |
N |
| isDeleted |
是否删除 |
boolean |
N |
| macAddress |
Mac地址 |
string |
N |
| mergeCustomerId |
这个客户合并后生成的新customerId |
string |
N |
| name |
联系人名称 |
string |
N |
| newCustomerId |
此时的新customerId |
string |
N |
| number |
客户编号 |
integer (int32) |
N |
| phone |
手机号 |
string |
N |
| phoneDesensitive |
脱敏手机号 |
string |
N |
| principalId |
负责人id |
integer (int64) |
N |
| principalName |
负责人名称 |
string |
N |
| productId |
产品ID |
string |
N |
| productSoleCode |
渠道code,比如微信的openID |
string |
N |
| staffId |
专属客服id |
integer (int64) |
N |
| tag |
标签,多个之间用英文逗号,分隔 |
string |
N |
| telephone |
联系电话 |
string |
N |
| tenantId |
租户ID |
string |
N |
| thirdPartUserId |
第三方系统用户ID |
string |
N |
| updateTime |
更新时间 |
string (date-time) |
N |
返回结果示例:
{
"code": "10000",
"data": {
"customer": {
"anonymous": 0,
"blacklist": "0",
"createTime": "string",
"customerGroupId": "1",
"customerId": "1",
"customerStatus": 1,
"customerType": 1,
"deleteTime": "string",
"deleted": true,
"desc": "string",
"email": "1",
"externalId": "1",
"id": 0,
"isDeleted": false,
"macAddress": "string",
"mergeCustomerId": "1",
"name": "string",
"newCustomerId": "1",
"number": 1,
"phone": "1",
"phoneDesensitive": "1",
"principalId": 123,
"principalName": "王五",
"productId": "1",
"productSoleCode": "string",
"staffId": 0,
"tag": "string",
"telephone": "1",
"tenantId": "1",
"thirdPartUserId": "1",
"updateTime": "string"
},
"customerDictList": [
{
"dictCode": "1",
"remark": "1",
"value": "1"
}
],
"customerGroupName": "1",
"isCustomerGroupDelete": false,
"productName": "1",
"staffName": "1"
},
"message": "请求成功"
}
结果码说明
| 结果码 |
说明 |
| 10000 |
请求成功 |
| 20001 |
请求失败 |
| 21002 |
认证失败,请重新登录 |
| 21012 |
用户名或密码错误 |
| 21013 |
错误超过限制,需要验证码通过 |
| 21116 |
非法的公司类型 |
| 21112 |
该账号已被注册 |
| 21114 |
激活码已过期 |
| 21115 |
激活码错误 |