商机模块
获取新增商机表单接口
接口地址
https://e-crm.icsoc.net/openapi/v1/opportunity/form/fields
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/opportunity/form/fields \
-H access-token={access-token} \
字段说明
- access-token:认证文档中的access_token
响应结果
{
"code": 200,
"message": "ok",
"data": [
{
"field_name": "opty_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": "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_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_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": 0,
"customFieldsOptionCount": 7
},
"field_type": "select",
"is_required": 1
}
]
}
字段说明
- field_name:字段唯一标识
- field_label:字段名称
- options:字段特殊选项设置,不同字段类型参见附录
- field_type:字段类型,所有字段类型参见附录
- is_requried:是否必填
c
商机详情接口
接口地址
https://e-crm.icsoc.net/openapi/v1/opportunity/{opty_id}
请求方式
curl -X GET \
http://e-crm-dev-k8s.icsoc.net/api/opportunity/{opty_id}" \
-H "accept: application/json" \
字段说明
- access-token:认证文档中的access_token
- opty_id: 商机ID 必填
响应结果
{
"code": 200,
"message": "ok",
"data": {
"_id": 6471982131139821569,
"opty_name": "商机",
"cle_id": "6470844909275561985",
"opty_type": 1,
"opty_type_name": "新客户商机",
"opty_source": 1,
"opty_source_name": "官网注册",
"opty_stage": 22,
"lose_order_reason": 0,
"lose_order_remark": "",
"sale_charge_user_id": 90002395,
"create_user_id": 90000172,
"create_time": 1543040783,
"update_user_id": 90000172,
"update_time": 1543040783,
"last_contact_user_id": 0,
"last_contact_time": 0,
"cle_name": "1112321323",
"cle_phone": "3121123123",
"opty_stage_name": "初步洽谈",
"lose_order_reason_name": "",
"sale_charge_user_name": "1214 luquan",
"sale_charge_department_id": 39,
"sale_charge_department_name": "测试分配策略",
"last_contact_user_name": "",
"last_contact_department_id": 0,
"last_contact_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": "6471982131139821569",
、、、
}
}
字段说明
- opty_name:商机名称
- opty_stage:商机阶段ID
- opty_source:商机来源ID
- opty_type:商机类型ID
- 更多字段参见商机字段参考说明
编辑商机表单接口
接口地址
https://e-crm.icsoc.net/openapi/v1/opportunity/{opty_id}/form/fields
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/opportunity/{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/opportunity/{opty_id}
请求方式
curl -X PUT \
http://e-crm-dev-k8s.icsoc.net/api/opportunity/{opty_id}" \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json" \
-d '{
"opty_name": "商机1",
"cle_id": "6470844909275561985",
"opty_type": 1,
"opty_stage": 22,
"opty_source": 1
}'
字段说明
- access-token:认证文档中的access_token
- cle_id: 客户ID 必填
- opty_name:商机名称
- opty_type:商机类型
- opty_source:商机来源
- 更多字段参考新增商机表单字段接口返回结果
响应结果
{
"code": 200,
"message": "ok",
"data": {
"id": "6471982131139821569",
"_id": 6471982131139821569
}
}
字段说明
- id:商机ID(string类型)
- _id:商机ID(int类型)
商机列表接口
接口地址
https://e-crm.icsoc.net/openapi/v1/opportunity/opportunities?page={page}&page_size={page_size}&cle_name={cle_name}&opty_name={opty_name}&opty_stage={opty_stage}&sort={sort}&order={order}&cursor=WzE1NDIzNTA0NzgsImNybV9jbGllbnRzIzY0NjkwODY3ODA0NTYxNTcxODUiXQQD
请求方式
curl -X GET \
https://e-crm.icsoc.net/openapi/v1/opportunity/opportunities?page={page}&page_size={page_size}&cle_name={cle_name}&opty_name={opty_name}&opty_stage={opty_stage}&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:客户名称,可选。若有值,返回符合条件的数据,匹配规则为模糊匹配。
- opty_name:商机名称,可选。若有值,返回符合条件的数据,匹配规则为模糊匹配。
- opty_stage:商机阶段,可选。若有值,返回符合条件的数据,匹配规则为精确匹配。
- sort:排序字段,可选。若有值,根据字段进行排序返回,默认为create_time。
- order:排序规则(asc,desc),默认为降序desc
响应结果
{
"code": 200,
"message": "ok",
"data": {
"cursor": "WzE1NDIzNTA0NzgsImNybV9jbGllbnRzIzY0NjkwODY3ODA0NTYxNTcxODUiXQQD",
"total": 4,
"rows": [
{
"_id": 6471982131139821569,
"opty_name": "商机1",
"cle_id": 6470844909275561985,
"opty_type": 1,
"opty_type_name": "新客户商机",
"opty_source": 1,
"opty_source_name": "官网注册",
"opty_stage": 22,
"lose_order_reason": 0,
"lose_order_remark": "",
"sale_charge_user_id": 90002395,
"create_user_id": 90000172,
"create_time": 1543040783,
"update_user_id": 90000172,
"update_time": 1543041375,
"last_contact_user_id": 0,
"last_contact_time": 0,
"cle_name": "1112321323",
"cle_phone": "3121123123",
"opty_stage_name": "初步洽谈",
"lose_order_reason_name": "",
"sale_charge_user_name": "1214 luquan",
"sale_charge_department_id": 39,
"sale_charge_department_name": "测试分配策略",
"last_contact_user_name": "",
"last_contact_department_id": 0,
"last_contact_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": "6471982131139821569"
},
{
"_id": 6471982002546655233,
"opty_name": "商机",
"cle_id": 6470844909275561985,
"opty_type": 1,
"opty_type_name": "新客户商机",
"opty_source": 1,
"opty_source_name": "官网注册",
"opty_stage": 22,
"lose_order_reason": 0,
"lose_order_remark": "",
"sale_charge_user_id": 90002395,
"create_user_id": 90000172,
"create_time": 1543040753,
"update_user_id": 90000172,
"update_time": 1543040753,
"last_contact_user_id": 0,
"last_contact_time": 0,
"cle_name": "1112321323",
"cle_phone": "3121123123",
"opty_stage_name": "初步洽谈",
"lose_order_reason_name": "",
"sale_charge_user_name": "1214 luquan",
"sale_charge_department_id": 39,
"sale_charge_department_name": "测试分配策略",
"last_contact_user_name": "",
"last_contact_department_id": 0,
"last_contact_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": "6471982002546655233"
},
、、、
]
}
}
字段说明
- total:总条数
- rows:结果集 (参数说明参见商机字段参考说明)
删除商机接口
支持批量删除
接口地址
https://e-crm.icsoc.net/openapi/v1/opportunity
请求方式
curl -X DELETE \
http://e-crm-dev-k8s.icsoc.net/api/opportunity" \
-H "accept: application/json" \
-H "access-token: {access-token}" \
-H "Content-Type: application/json" \
-d '{
"ids":[6471982131139821569,6471982131139821569]
}'
字段说明
- access-token:认证文档中的access_token
- ids:商机ID集合
响应结果
{
"code": 200,
"message": "ok",
"data": []
}
商机字段说明
参数名 | 参数说明 |
---|---|
_id | 商机ID |
opty_name | 商机名称 |
cle_id | 客户ID |
opty_type | 商机类型ID |
opty_type_name | 商机名称 |
opty_source | 商机来源ID |
opty_stage | 销售阶段ID |
opty_source_name | 商机来源名称 |
lose_order_reason | 输单原因ID |
lose_order_remark | 输单备注 |
sale_charge_user_id | 销售负责人ID |
create_user_id | 创建人ID |
create_time | 创建时间 |
update_user_id | 更新人ID |
update_time | 更新时间 |
last_contact_user_id | 最近跟进人ID |
last_contact_time | 最近跟进时间 |
cle_name | 客户名称 |
cle_phone | 客户电话 |
lose_order_reason_name | 输单原因说明 |
sale_charge_user_name | 销售负责人名称(坐席工号+空格+坐席名称) |
sale_charge_department_id | 销售负责部门ID |
sale_charge_department_name | 销售负责部门名 |
last_contact_user_name | 最近跟进人名称(坐席工号+空格+坐席名称) |
last_contact_department_id | 最近跟进部门ID |
last_contact_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类型,供前端使用) |