You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

81 lines
3.2 KiB

meta {
name: 快速添加联系人
type: http
seq: 2
tags: [
generated
]
}
post {
url: {{baseUrl}}/api/customer/contact/quickAdd
body: formUrlEncoded
auth: inherit
}
body:form-urlencoded {
customerId: 753314901191032832
rows[0].name: cg034667张总
rows[0].jobTitleCode: chairman
rows[0].phone: 13800001001
rows[0].source: group_meeting
rows[0].isKeyContact: 1
rows[1].name: cg034667李经理
rows[1].jobTitleCode: marketing_manager
rows[1].phone: 13800001002
rows[1].source: group_activity
rows[1].isKeyContact: 0
}
docs {
# 快速添加联系人(多行)
`POST /api/customer/contact/quickAdd`(本行兼作对账钥匙,勿手改)
部分成功:合法行落库、非法行明细返回(空行跳过;有手机号按手机号查重、无手机号按客户+姓名+职务疑似重复提示不静默创建);职务走 job_title 字典 code 联动补全 id/名称/类别/档位(D1 初始值,level_source=1);任一行成功即 bump 图谱版本。失败行留在编辑器改完只重提失败行,不重复创建;行号 rowIndex 按提交数组下标从 0 计。
## 请求参数
| 参数 | 类型 | 必填 | 默认 | 说明 |
| --- | --- | --- | --- | --- |
| customerId | string | 是 | - | 目标客户 id(固定,不可切换) |
| rows[i].name | string | 是 | - | 联系人姓名 |
| rows[i].jobTitleCode | string | 是 | - | 标准职务字典 code(job_title 组二级项;联动补全 id/名称/类别/档位) |
| rows[i].phone | string | 否 | - | 手机号(可空;非空须 11 位格式) |
| rows[i].source | string | 否 | - | 来源字典 code(contact_source 组,可空) |
| rows[i].isKeyContact | number | 否 | 0 | 是否关键联系人(是1/否0,空=0) |
## 请求示例
请求头:Authorization: Bearer {{token}}
Content-Type: application/x-www-form-urlencoded
POST /api/customer/contact/quickAdd
customerId=753314901191032832&rows[0].name=cg034667张总&rows[0].jobTitleCode=chairman&rows[0].phone=13800001001&rows[0].source=group_meeting&rows[0].isKeyContact=1&rows[1].name=cg034667李经理&rows[1].jobTitleCode=marketing_manager&rows[1].phone=13800001002&rows[1].source=group_activity&rows[1].isKeyContact=0&rows[2].name=cg034667王专员&rows[2].jobTitleCode=marketing_specialist&rows[2].phone=13800001003&rows[2].source=referral&rows[2].isKeyContact=0&rows[3].name=cg034667赵四&rows[3].jobTitleCode=other_job&rows[3].phone=13800001004&rows[3].source=other&rows[3].isKeyContact=0
## 响应 data 结构
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| successCount | number | 成功行数(部分成功:合法行落库) |
| failedRows | array | 失败行明细(空=全部成功) |
| failedRows[].rowIndex | number | 行号(提交数组下标,从 0 计) |
| failedRows[].reason | string | 失败原因(行级校验/查重提示) |
## 错误码
- 67021 快速添加整批不可用(行集空;行级错误走结果明细 200)
## 响应示例
// 示例数据(E2E 实测真值),字段结构以上表为准
```json
{
"code": 0,
"success": true,
"message": "success",
"data": {
"successCount": 4,
"failedRows": []
}
}
```
}