2.3 任务联系人管理

2.3.1 任务联系人上传(文件方式)

基本信息
Path: /api/v1/config/openapi/contact/uploadDataSource/v2
Method: POST
接口描述:
任务联系人上传,可追加和覆盖。
1. 存在任务进行中,任务暂停,任务完成,只能追加不能覆盖
2. 任务新创建,若30min中内将要开始,只能追加不能覆盖
3. 每天凌晨0点到2点。不能操作上传
请求参数
Headers
参数名称参数值是否必须示例备注
Content-Typemultipart/form-data  
Body
参数名称参数类型是否必须示例备注
dataSourceFilefile Csv文件,文件编码格式为GBK
companyIdtext 企业id
abbreviatetext 企业缩写
dataSourceNametext 数据源名称
operationTypetext 0:追加 1:覆盖
dataSourceTypetext 数据源类型 0上传数据源(默认)
tokentext token
返回数据
名称类型是否必须默认值备注其他信息
 codeinteger必须 返回码 
 msgstring必须 返回说明 

2.3.2 DNC联系人上传(文件方式)

基本信息
Path: /api/v1/config/openapi/contact/uploadDncDataSource/v2
Method: POST
接口描述:
请求参数
Headers
参数名称参数值是否必须示例备注
Content-Typemultipart/form-data  
Body
参数名称参数类型是否必须示例备注
dataSourceFilefile csv文件,GBK编码,只有uuid一列
companyIdtext 企业id
abbreviatetext 企业缩写
dataSourceNametext 数据源名称
dataSourceTypetext 数据源类型 1:DNC数据源(默认)
tokentext token
返回数据
名称类型是否必须默认值备注其他信息
 codeinteger必须 返回码 
 msgstring必须 返回说明 
调用范例:
  • import com.alibaba.fastjson.JSON;
  • import org.springframework.core.io.FileSystemResource;
  • import org.springframework.http.HttpEntity;
  • import org.springframework.http.HttpHeaders;
  • import org.springframework.http.MediaType;
  • import org.springframework.http.ResponseEntity;
  • import org.springframework.util.LinkedMultiValueMap;
  • import org.springframework.util.MultiValueMap;
  • import org.springframework.web.client.RestTemplate;
  •  
  • import java.io.File;
  • import java.util.Map;
  •  
  • /**
  •  * @author yangsl
  •  * @Description 上传联系人demo
  •  * @date 2021/6/17
  •  */
  • public class Demo {
  •  
  •     public static void main(String[] args) {
  •         String url = "https://domain/api/v1/config/openapi/contact/uploadDataSource/v2"; //domain替换成对应环境url
  •         String filePath = "C:\\Users\\Mac\\Downloads\\template(1).csv";//上传文件的目录
  •         File file = new File(filePath);
  •         // 文件必须封装成FileSystemResource这个类型后端才能收到附件
  •         FileSystemResource resource = new FileSystemResource(file);
  •         RestTemplate restTemplate = new RestTemplate();
  •         HttpHeaders headers = new HttpHeaders();
  •         MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
  •         //接口参数 请替换成对应数据
  •         map.add("abbreviate", "yangsl");
  •         map.add("dataSourceFile", resource);
  •         map.add("dataSourceType", 0);
  •         map.add("dataSourceName", "123456");
  •         map.add("operationType", "123456");
  •         map.add("token", "123456"); 
  •         //头部类型
  •         headers.setContentType(MediaType.MULTIPART_FORM_DATA);
  •         //构造实体对象
  •         HttpEntity<MultiValueMap<String, Object>> param = new HttpEntity<>(map, headers);
  •         //发起请求,服务地址,请求参数,返回消息体的数据类型
  •         ResponseEntity<String> response = restTemplate.postForEntity(url, param, String.class);
  •         //body
  •         String body = response.getBody();
  •         System.out.println(body);
  •         //JSON格式转为Map类型
  •         Map result = JSON.parseObject(body, Map.class);
  •         System.out.println(result);
  •     }
  •  
  • }
 

2.3.3 任务联系人上传(json追加方式)

基本信息
Path: /api/v1/config/openapi/contact/batch/json/upload
Method: POST
接口描述:
请求示例
  • {
  •     "dataSourceName":"数据源名称",
  •     "dataList":[
  •         [
  •             "列1",
  •             "列2",
  •             "列3"
  •         ],
  •         [
  •             "列1",
  •             "列2",
  •             "列3"
  •         ]
  •     ],
  •     "abbreviate":"yangsl"
  • }
 
请求参数
Headers
参数名称参数值是否必须示例备注
Content-Typeapplication/json  
tokenImixBz8ebhRDCmBKaq70jHMjU3xt1Pkai9SAsOFjN2z6RpX8cTPr1/gEFkssjRFY  
Body
名称类型是否必须默认值备注其他信息
 abbreviatestring必须 企业缩写 
 companyIdinteger非必须 企业id 
 dataListarray []必须 联系人数据item 类型: array
├─ 非必须 数据行 
├─ 非必须 数据列 
 dataSourceNamestring必须 数据源名称 
返回数据
名称类型是否必须默认值备注其他信息
 codeinteger必须 返回码 
 msgstring必须 返回说明 

2.3.4 联系人组字段信息查询

基本信息
Path: /api/v1/config/openapi/contact/contactGroupDetail
Method: GET
接口描述:
请求参数
Headers
参数名称参数值是否必须示例备注
tokenImixBz8ebhRDCmBKaq70jHMjU3xt1Pkai9SAsOFjN2z6RpX8cTPr1/gEFkssjRFY  
Query
参数名称是否必须示例备注
abbreviate 企业缩写
返回数据
名称类型是否必须默认值备注其他信息
 msgstring必须 返回消息 
 codeinteger必须 返回码 
 dataobject []非必须 返回结果item 类型: object
├─ companyIdinteger非必须 企业id 
├─ abbreviatestring非必须 企业缩写 
├─ idinteger非必须 联系人组id 
├─ typeinteger必须 数据源类型  0:datasource数据源,
1:过滤号码数据源
 
├─ groupNamestring非必须 联系人组名称 
├─ totalinteger非必须 联系人总数 
├─ utimeinteger非必须 更新时间 
├─ dataSourceNamestring非必须 数据源名称 
├─ customFieldsobject []非必须 联系人组字段列表item 类型: object
customFields├─ idinteger非必须 联系人组属性字段id 
customFields├─ namestring非必须 联系人组属性名称 
customFields├─ type1integer非必须 是否必选 
customFields├─ type2string非必须 联系人组类型 
customFields├─ lengthinteger非必须 联系人组长度 

2.3.5 DNC联系人上传(json方式)

基本信息
Path: /api/v1/config/openapi/dataSource/uploadDnc/json
Method: POST
接口描述:
请求示例
 { 
  •   "dataSourceName" :  "JICHU-DNC" , 
  •   "dataList" : [ 
  •   "1" , 
  •   "2" , 
  •   "3" 
  •   ], 
  •   "abbreviate" :  "yangsl" 
请求参数
Headers
参数名称 参数值 是否必须 示例 备注 
Content-Typeapplication/json  
tokenImixBz8ebhRDCmBKaq70jHMjU3xt1Pkai9SAsOFjN2z6RpX8cTPr1/gEFkssjRFY  
Body
名称 类型 是否必须 默认值 备注 其他信息 
 abbreviatestring必须 企业缩写 
 dataListarray []必须 联系人UUID列表item 类型: string
 dataSourceNamestring必须 数据源名称 
返回数据
名称 类型 是否必须 默认值 备注 其他信息 
 codeinteger必须 返回码 
 msgstring必须 返回说明