联系人模块
获取新增联系人表单接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact/form/fields
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/contact/form/fields \
-H access-token={access-token} \
字段说明
- access-token:认证文档中的access_token
响应结果
{
"code": 200,
"message": "ok",
"data": [
{
"field_name": "contact_name",
"field_label": "姓名",
"options": [],
"field_type": "input",
"is_required": 1
},
{
"field_name": "cle_id",
"field_label": "客户名称",
"options": {
"association_type": "client.list",
"display_field_name": "cle_name",
"url": "api/client/smartSearch",
"dynamic_value": [],
"display_value": {
"cle_id": "0",
"cle_name": ""
}
},
"field_type": "association",
"is_required": 1
},
{
"field_name": "mobile",
"field_label": "电话",
"options": [],
"field_type": "telephone",
"is_required": 1
},
{
"field_name": "email",
"field_label": "邮箱",
"options": [],
"field_type": "email",
"is_required": 0
},
{
"field_name": "contact_duty",
"field_label": "职务",
"options": {
"customFieldsOptionNames": [
{
"text": "经理",
"value": 1
},
{
"text": "总监",
"value": 2
}
],
"customFieldsOptionNamesKeys": [
0,
1
],
"customFieldsOptionDefault": "",
"customFieldsOptionCount": 2
},
"field_type": "select",
"is_required": 0
},
{
"field_name": "contact_type",
"field_label": "联系人类型",
"options": {
"customFieldsOptionNames": [
{
"text": "关键决策人",
"value": 1
},
{
"text": "一般决策人",
"value": 2
}
],
"customFieldsOptionNamesKeys": [
0,
1
],
"customFieldsOptionDefault": "",
"customFieldsOptionCount": 2
},
"field_type": "select",
"is_required": 1
}
]
}
字段说明
- field_name:字段唯一标识
- field_label:字段名称
- options:字段特殊选项设置,不同字段类型参见附录
- field_type:字段类型,所有字段类型参见附录
- is_requried:是否必填
新增联系人接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact
请求方式
curl -X POST \
https://e-crm.icsoc.net/openapi/v1/contact" \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json" \
-d '{
"cle_id": "6471966599082655745",
"contact_name": "联系人A",
"mobile": "18771124554",
"email": "",
"contact_duty": 1,
"contact_type": 1
}'
字段说明
- access-token:认证文档中的access_token
- cle_id: 客户ID 必填
- contact_name:联系人名称
- mobile:联系人类型
- email:联系人来源
- contact_duty:职务
- contact_type:联系人类型
- 更多字段参考新增联系人表单字段接口返回结果
响应结果
{
"code": 200,
"message": "ok",
"data": {
"id": "6471989970289803265",
"_id": 6471989970289803000
}
}
字段说明
- id:联系人ID(string类型)
- _id:联系人ID(int类型)
联系人信息接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact/{contact_id}
请求方式
curl -X GET \
http://e-crm-dev-k8s.icsoc.net/api/contact/{contact_id}" \
-H "accept: application/json" \
字段说明
- access-token:认证文档中的access_token
- contact_id: 联系人ID 必填
响应结果
{
"code": 200,
"message": "ok",
"data": {
"_id": 6471989970289803265,
"contact_name": "联系人A",
"cle_id": "6471966599082655745",
"mobile": "18771124554",
"email": "",
"contact_duty": 1,
"contact_duty_name": "经理",
"contact_type": 1,
"contact_type_name": "关键决策人",
"sale_charge_user_id": 0,
"create_user_id": 90000172,
"create_time": 1543042652,
"update_user_id": 90000172,
"update_time": 1543042652,
"original_id": 0,
"cle_name": "张三",
"sale_charge_user_name": "",
"sale_charge_department_id": 0,
"sale_charge_department_name": "",
"vcc_id": 90000000,
"create_user_name": "8002 8002坐席",
"create_department_id": 1,
"create_department_name": "公司",
"update_user_name": "8002 8002坐席",
"update_department_id": 1,
"update_department_name": "公司",
"id": "6471989970289803265",
、、、
}
}
字段说明
- contact_name:联系人名称
- mobile:联系人类型
- email:联系人来源
- contact_duty:职务
- contact_type:联系人类型
- 更多字段参考联系人字段说明
编辑联系人表单接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact/{opty_id}/form/fields
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/contact/{opty_id}/form/fields \
-H access-token={access-token} \
字段说明
- access-token:认证文档中的access_token
- opty_id:联系人ID 必填
响应结果
{
"code": 200,
"message": "ok",
"data": [
{
"field_name": "opty_name",
"field_label": "联系人名称",
"options": [],
"field_type": "input",
"is_required": 1,
"field_value": "联系人"
},
{
"field_name": "cle_id",
"field_label": "客户名称",
"options": {
"association_type": "client.list",
"display_field_name": "cle_name",
"url": "api/client/smartSearch",
"dynamic_value": [],
"display_value": {
"cle_id": "6470844909275561985",
"cle_name": "1112321323"
}
},
"field_type": "association",
"is_required": 1,
"field_value": "6470844909275561985"
},
{
"field_name": "opty_type",
"field_label": "联系人类型",
"options": {
"customFieldsOptionNames": [
{
"text": "新客户联系人",
"value": 1
},
{
"text": "老客户联系人",
"value": 2
}
],
"customFieldsOptionNamesKeys": [
0,
1
],
"customFieldsOptionDefault": "",
"customFieldsOptionCount": 2
},
"field_type": "select",
"is_required": 1,
"field_value": 1
},
{
"field_name": "opty_source",
"field_label": "联系人来源",
"options": {
"customFieldsOptionNames": [
{
"text": "官网注册",
"value": 1
},
{
"text": "在线咨询",
"value": 2
},
{
"text": "电话咨询",
"value": 3
},
{
"text": "销售自有",
"value": 4
},
{
"text": "老客户介绍",
"value": 5
},
{
"text": "其他",
"value": 6
}
],
"customFieldsOptionNamesKeys": [
0,
1,
2,
3,
4,
5
],
"customFieldsOptionDefault": "",
"customFieldsOptionCount": 6
},
"field_type": "select",
"is_required": 1,
"field_value": 1
},
{
"field_name": "opty_stage",
"field_label": "销售阶段\t",
"options": {
"display_field_name": "opty_stage_name",
"customFieldsOptionNames": [
{
"value": 22,
"text": "初步洽谈"
},
{
"value": 23,
"text": "需求确定"
},
{
"value": 24,
"text": "商务谈判"
},
{
"value": 25,
"text": "赢单"
},
{
"value": 26,
"text": "输单"
},
{
"value": 42,
"text": "123123123"
},
{
"value": 43,
"text": "1231231"
}
],
"customFieldsOptionDefault": 22,
"customFieldsOptionCount": 7
},
"field_type": "select",
"is_required": 1,
"field_value": 22
},
、、、
]
}
字段说明
- field_name:字段唯一标识
- field_label:字段名称
- options:字段特殊选项设置,不同字段类型参见附录
- field_type:字段类型,所有字段类型参见附录
- is_requried:是否必填
- field_value:编辑联系人的当前值
编辑联系人接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact/{opty_id}
请求方式
curl -X PUT \
http://e-crm-dev-k8s.icsoc.net/api/contact/{contact_id}" \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json" \
-d '{
"cle_id": "6471966599082655745",
"contact_name": "联系人A11",
"mobile": "18771124554",
"email": "",
"contact_duty": 1,
"contact_type": 1
}'
字段说明
- access-token:认证文档中的access_token
- cle_id: 客户ID 必填
- contact_name:联系人名称
- mobile:联系人类型
- email:联系人来源
- contact_duty:职务
- contact_type:联系人类型
- 更多字段参考新增联系人表单字段接口返回结果
响应结果
{
"code": 200,
"message": "ok",
"data": {
"id": "6471989970289803265",
"_id": 6471989970289803265
}
}
字段说明
- id:联系人ID(string类型)
- _id:联系人ID(int类型)
联系人列表接口
接口地址
https://e-crm.icsoc.net/openapi/v1/contact/contacts?page={page}&page_size={page_size}&cle_name={cle_name}&contact_name={contact_name}&sort={sort}&order={order}&cursor=WzE1NDIzNTA0NzgsImNybV9jbGllbnRzIzY0NjkwODY3ODA0NTYxNTcxODUiXQQD
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/contact/contacts?page={page}&page_size={page_size}&cle_name={cle_name}&contact_name={contact_name}&sort={sort}&order={order} \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json"
字段说明
- access-token:认证文档中的access_token
- cursor: 游标,第一次查询时无需传该值,后续查询时,将上一次查询获取数据中的cursor传递过来即可,此字段用于分页查询
- page_size:客户名称每页显示条数。可选,默认为10。
- cle_name:客户名称,可选。若有值,返回符合条件的数据,匹配规则为模糊匹配。
- contact_name:联系人名称,可选。若有值,返回符合条件的数据,匹配规则为模糊匹配。
- sort:排序字段,可选。若有值,根据字段进行排序返回,默认为create_time。
- order:排序规则(asc,desc),默认为降序desc
响应结果
{
"code": 200,
"message": "ok",
"data": {
"cursor": "WzE1NDIzNTA0NzgsImNybV9jbGllbnRzIzY0NjkwODY3ODA0NTYxNTcxODUiXQQD",
"total": 11,
"rows": [
{
"_id": 6471989970289803265,
"contact_name": "联系人A11",
"cle_id": 6471966599082655745,
"mobile": "18771124554",
"email": "",
"contact_duty": 1,
"contact_duty_name": "经理",
"contact_type": 1,
"contact_type_name": "关键决策人",
"sale_charge_user_id": 0,
"create_user_id": 90000172,
"create_time": 1543042652,
"update_user_id": 90000172,
"update_time": 1543042907,
"original_id": 0,
"cle_name": "张三",
"sale_charge_user_name": "",
"sale_charge_department_id": 0,
"sale_charge_department_name": "",
"vcc_id": 90000000,
"create_user_name": "8002 8002坐席",
"create_department_id": 1,
"create_department_name": "公司",
"update_user_name": "8002 8002坐席",
"update_department_id": 1,
"update_department_name": 0,
"id": "6471989970289803265"
},
{
"_id": 6470567049784705025,
"contact_name": "32123",
"cle_id": 6470211827556139009,
"mobile": "12312312",
"email": "",
"contact_duty": 2,
"contact_duty_name": "总监",
"contact_type": 1,
"contact_type_name": "关键决策人",
"sale_charge_user_id": 0,
"create_user_id": 90000172,
"create_time": 1542703401,
"update_user_id": 90000172,
"update_time": 1542703401,
"original_id": 0,
"cle_name": "test测试异步脚本97",
"sale_charge_user_name": "",
"sale_charge_department_id": 0,
"sale_charge_department_name": "",
"vcc_id": 90000000,
"create_user_name": "8002 8002坐席",
"create_department_id": 1,
"create_department_name": "公司",
"update_user_name": "8002 8002坐席",
"update_department_id": 1,
"update_department_name": "公司",
"id": "6470567049784705025"
},
、、、
]
}
}
字段说明
- total:总条数
- rows:结果集 (参数说明参见联系人字段说明)
删除联系人接口
支持批量删除
接口地址
https://e-crm.icsoc.net/openapi/v1/contact
请求方式
curl -X DELETE \
http://e-crm-dev-k8s.icsoc.net/api/contact" \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json" \
-d '{
"ids":[6471989970289803265,6470567049784705025]
}'
字段说明
- access-token:认证文档中的access_token
- ids:联系人ID集合
响应结果
{
"code": 200,
"message": "ok",
"data": []
}
联系人字段说明
参数名 | 参数说明 |
---|---|
_id | 联系人ID |
contact_name | 联系人名称 |
mobile | 联系人手机 |
邮箱 | |
contact_duty | 职责务ID |
contact_duty_name | 职务名称 |
contact_type | 联系人类型 |
contact_type_name | 联系人类型名称 |
sale_charge_user_id | 销售负责人ID |
create_user_id | 创建人ID |
create_time | 创建时间 |
update_user_id | 更新人ID |
update_time | 更新时间 |
sale_charge_user_name | 销售负责人名称(坐席工号+空格+坐席名称) |
sale_charge_department_id | 销售部门ID |
sale_charge_department_name | 销售部门名 |
create_user_name | 创建人名称(坐席工号+空格+坐席名称) |
create_department_id | 创建部门ID |
create_department_name | 创建部门名 |
update_user_name | 更新人名称(坐席工号+空格+坐席名称) |
update_department_id | 更新部门ID |
update_department_name | 更新部门名 |
id | 联系人ID冗余字段,(string类型,供前端使用) |