简要描述:

  • SOP任务-任务详情

请求域名:

  • http://xx.com

请求URL:

xx.com/business/{公众号id}/plugin/SopTask/saveTask

请求类型

POST

参数:

参数名 是否必须 类型 说明
id int 任务id,不传则新建
form.task_type int 任务类型,1会员2消息3生日4群sop;5=朋友圈sop
form.name string 任务名称
form.is_open int 是否开启
form.execution_type array 1关系链上级第一位成员,2首次添加企业微信成员,3随机抽选一位成员。task_type为4时,1为群主,2为指定成员
form.task_set object 如下
form.content_list array 如下
form.executor array task_type为4并且execution_type为2时传入,[{id:1},{id:2}]保证有id即可;

form.executor

//朋友圈sop
{
            "department_list": [1,2],//部门id(wechat_department_id企业微信部门id)
            "user_list": ["xx" "xxx"]//员工user_id
}

任务内容content_list

//朋友圈sop
{
            "additional": 0, //附加内容0=关闭;1=开启
            "msgtype": 1, //0=图片;1=链接;2=视频
            "images": [
                "http://dummyimage.com/400x400",
                "http://dummyimage.com/400x400",
                "http://dummyimage.com/400x400",
                "http://dummyimage.com/400x400"
            ],
            "video": "https://ysm-1251768088.cos.ap-guangzhou.myqcloud.com/videos/25/2024/05/284910c231b94c97a087a40a1f531d42.mp4",
            "link": {
                "image": "http://dummyimage.com/400x400",
                "title": "",
                "url": "http://dummyimage.com/400x400"
            },
            "text": "deserunt sint nisi"
}

// 消息任务
[
	{
		'type' : 'text'
		'news' : '文本消息'
	}
	{
		'type' : 'image'
		'link_img':'图片地址'
	}
	{
		'type' : 'link'
		'title' : '链接标题',
		'link' : '链接地址',
		'describe' : '链接描述',
		'link_img' : '链接封面'
	}
	{
		'type' : 'applet'
		'title' : '小程序标题',
		'appid' : '小程序appid',
		'page' : '小程序page路径',
		'link_img' : '小程序封面',
	}
	{
		'type' : 'video'
		'link_video' : '视频地址'
	}
	{
		'type' : 'file'
		'link_file' : '文件地址'
	}
]

任务设置task_set

// 会员任务
{
    'tag_list' : array()  // 标签列表,[{id:1,name:'哈哈',tag_id:'afdfgsaewr435'},...],保证有tag_id即可
    'start_time' : ''  // 任务开始时间,格式2022-01-01
	'end_time' : ''  // 任务结束时间,格式2022-01-01
	'send_time_type' : 1  // 1固定时间,2达成任务条件推送
	'send_time' : ''  // '0:00' 每天0点,'1:00' 每天1点,'2:00' 每天2点...
}

// 消息任务
{
    'date_type' : 1  // 日期类型,1节日推送,2指定日期
    'date_list' : array()  // [{'holiday_name'=>'春节','date'=>'2022-02-01'},...],指定日期为[{'holiday_name'=>'2022-02-01','date'=>'2022-02-01'}]
	'send_target' : 1  // 1全体成员,2指定标签成员
	'tag_list' : array()  // 同上
	'send_time_type' : 1  // 1前几天,2当天
	'send_time' : 1  // 同上
	'send_time_before' : 1  // 1前一天,2前两天...
}

// 生日任务
{
    'start_time' : ''  // 格式同上
    'end_time' : ''  // 格式同上
	'send_time_type' : 1  // 1前几天,2当天
	'send_time_before' : 1 // 1前一天,2前两天,3前三天...
	'send_time' : ''  // 同上
}

// 群聊任务
{
  "group_type": 1 // 类型条件 1指定群聊,2条件筛选
  "target_type": 1 // 选择类型(group_type为2时) 1选择群主,2选择群成员,3选择群标签
  "target_list": [] // 选择条件 or 选择群聊,[{id:1},{id:2}](保证有id即可)
  "send_date_type": 1 // 推送时间类型 1创建每几天,2创建后,3创建后某小时
  "time_day": 0 // 天,send_date_type为1、2时
  "time_hour": "0:00" // 小时,send_date_type为1、2时
  "after_hour": 2 // 创建后某小时,send_date_type为3时
  "after_min": 10 // 创建后某分钟,send_date_type为3时
  "end_date": "2022-02-02"// 结束时间,send_date_type为1时
  "exclude_group": [] // 排除群聊[{id:1},{id:2}](保证有id即可),group_type为2时传入
}


//朋友圈sop

{
            "push_type": 0, //0=固定时间;1=立即发送
            "tag_list": [ //标签
                "non incididunt minim aliqua dolore",
                "ut non quis",
                "sunt eu occaecat voluptate"
            ],
            "execute_time": "1992-01-18 14:24:40" //固定时间
}

返回示例:

正确时返回:

{
	"result": 1,
	"msg": "成功",
	"data": {
		"id": 2,
		"member_id": 164936,
		"name": "任务名称",
		"is_open": 1,
		"task_type":1,
		"execution_type": [
			"1",
			"2",
			"3"
		],
		"task_set": {
			"tag_list": [],
			"start_time": "",
			"end_time": "",
			"send_time_type": 1,
			"send_time": "0:00"
		},
		"content_list": [
			{
				"type": "text",
				"news": ""
			},
			{
				"type": "image",
				"link_img": ""
			},
			{
				"type": "link",
				"title": "",
				"link": "",
				"describe": "",
				"link_img": ""
			},
			{
				"type": "applet",
				"title": "",
				"appid": "",
				"page": "",
				"link_img": ""
			},
			{
				"type": "video",
				"link_video": ""
			},
			{
				"type": "file",
				"link_file": ""
			}
		],
		"created_at": "2022-01-12 10:43:51",
		"condition": []
	}
}

错误时返回: