任务创建为异步创建,本文介绍创建任务相关的两个接口:发起异步任务创建、查询异步任务结果。
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
name | string | 是 | 任务名称 |
mode | int64 | 是 | 任务触发类型 |
channel | int64 | 是 | 通道类型 |
channel_id | int64 | 是 | 通道 ID |
trigger_config | int64 | 是 | 任务触发配置,参数详情请参见下文trigger_config |
channel_config | object | 是 | 通道配置,参数详情请参见下文channel_config |
creator_id | int64 | 是 | 创建人 ID |
app_id | int64 | 是 | 项目 ID |
crowd_uid | string | 是 | cdp 人群 ID |
crowd_meta_type | int64 | 是 | 人群类型
|
finder_app_id | int64 | 是 | finder 应用 ID |
group_info | list | 否 | 多级分组 ID 路径 |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
finish_a_config | object | 是 | 触发 a 类型配置,参数详情请参见下文finish_a_config |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
start_time | int64 | 是 | 开始时间 |
end_time | int64 | 是 | 结束时间 |
final_end_time | int64 | 是 | 最终结束时间 |
finish_times | int64 | 是 | 完成次数 |
type | int64 | 是 | 完成类型:每次,一次 |
event_as | list | 是 | 事件配置,参数详情请参见下文event_as |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
event | string | 是 | 某一个时间的唯一标识 |
condition | int64 | 是 | 条件的且或逻辑 |
filter_condition_list | list | 否 | 事件属性条件配置,参数详情请参见下文filter_condition_list |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
condition_name | string | 否 | 事件属性唯一标识 |
condition_type | string | 否 | 属性条件类型 |
condition_value | string | 否 | 属性条件值 |
value_type | int64 | 否 | 属性类型 |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
global_frequency_ctr | boolean | 是 | 全局频控 |
channel_basic_send_content_config | object | 是 | 通道内容设置,参数详情请参见下文channel_basic_send_content_config |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
webhook_b_content | object | 否 | webhook 内容配置,参数详情请参见下文webhook_b_content |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
header_params | map[string]string | 否 | header 的各参数配置 |
query_params | map[string]string | 否 | query 的各参数配置 |
body_params | map[string]string | 否 | body 的各参数配置 |
curl --location 'https://xxxx.volces.com/gmpl/gmp/openapi/v1/task/add_async_task' \ --header 'Authorization: ak-v1/56wXBoPxxxx/170948xxxx/300000xxxx/218d7d8c7d2a170xxxx' \ --header 'Content-Type: application/json' \ --data '[ { "name": "测试openapi", "mode": 3, "channel": 11, "channel_id": 12, "trigger_config": { "finish_a_config": { "start_time": 1714994337, "end_time": 1714994337, "final_end_time": 1714994337, "finish_times": 1, "type": 1, "event_as": [ { "event": "21:17114:bottom_tab_clickxxxx", "condition": 1, "filter_condition_list": [ { "condition_name": "$app_version", "condition_type": "=", "condition_value": "111", "value_type": 2 } ] } ] } }, "channel_config": { "global_frequency_ctr": true, "channel_basic_send_content_config": { "webhook_b_content": { "header_params": {}, "query_params": {}, "body_params": { "template_code": "$.template_code", "success_rate": "100", "callback_rate": "100", "callback_success_rate": "100", "final_msg": "$.template_content", "main_account_id": "-1", "press_callback": "2", "callback_after": "1", "key1": "https://xxxx.volces.com/gmp/webhook", "key2": "您好", "key3": "90.9", "key4": "[{\"ParamType\":1,\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"12\"},{\"ParamType\":1,\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"34\"}]", "key5": "[{\"ParamType\":1,\"ParamName\":\"string\",\"DisplayName\":\"字符串\",\"IsRequire\":false,\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"string\"}]", "key6": "[{\"key\":\"4e25.dea9c2f3b6eab.94xxxx\",\"ParamName\":\"city\",\"DisplayName\":\"city\",\"ParamType\":1,\"IsRequire\":false,\"WebhookImageConf\":{\"SizeLimit\":null,\"ImageSizeType\":1,\"MaxWidth\":null,\"MaxHeight\":null},\"SelectTypeConf\":{\"OptionInputType\":\"customer\",\"OptionConfs\":[]},\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"beijing\"},{\"key\":\"c352.6a4ab9e0a5ac2.3ab9xxxx\",\"ParamName\":\"name\",\"DisplayName\":\"name\",\"ParamType\":1,\"IsRequire\":false,\"WebhookImageConf\":{\"SizeLimit\":null,\"ImageSizeType\":1,\"MaxWidth\":null,\"MaxHeight\":null},\"SelectTypeConf\":{\"OptionInputType\":\"customer\",\"OptionConfs\":[]},\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"duoduo \"},{\"key\":\"2811.3f7bd1c79ec23.de53xxxx\",\"ParamName\":\"age\",\"DisplayName\":\"age\",\"ParamType\":1,\"IsRequire\":false,\"WebhookImageConf\":{\"SizeLimit\":null,\"ImageSizeType\":1,\"MaxWidth\":null,\"MaxHeight\":null},\"SelectTypeConf\":{\"OptionInputType\":\"customer\",\"OptionConfs\":[]},\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"18\"},{\"key\":\"06f6.c10a9d2646b97.0bxxxx\",\"ParamName\":\"url\",\"DisplayName\":\"url\",\"ParamType\":2,\"IsRequire\":false,\"WebhookImageConf\":{\"SizeLimit\":null,\"ImageSizeType\":1,\"MaxWidth\":null,\"MaxHeight\":null},\"SelectTypeConf\":{\"OptionInputType\":\"customer\",\"OptionConfs\":[]},\"richTextOptions\":{\"ShowLabel\":true,\"ShowEvent\":false,\"showCustomParams\":false,\"ShowLandingPage\":true,\"showDefaultValue\":true},\"Value\":\"https://xxxx.volces.com/gmp/task/copy/31518?appId=2\"}]", "key7": "1", "key8": "[\"3\"]", "key9": "5", "key10": "2023:11:23", "key11": "2023:11:24 20:59:27", "key12": "__GMP_RESOURCE_PATH__/gmp/public/b3499e1d16741e6b913b15382a9xxxx.png",//图片传公网链接 "key13": "!{baseid}", "key14": "!{baseid=1}" } } } }, "creator_id": 1, "app_id": 1, "crowd_uid": "100xxxx", "crowd_meta_type":2, "finder_app_id": 10000000, "group_info": [1,2,3] } ]'
参数 | 类型 | 描述 |
|---|---|---|
code | int32 | 错误码,正常返回 0 |
data | object | 查询的任务列表 |
msg | string | 结果信息 |
log_id | string | trace |
data.asyn_task_id | int64 | 提交的异步任务 ID |
参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
project_id | int64 | 是 | 项目 ID |
asyn_task_id | int64 | 是 | 提交的异步任务 ID |
参数 | 类型 | 描述 |
|---|---|---|
code | int32 | 错误码,正常返回 0 |
data | object | 查询的任务列表 |
msg | string | 结果信息 |
log_id | string | trace |
data.status | int64 | 异步任务完成状态
|
data.task_id | int64 | 消息触达任务 ID |
data.task_status | int64 | 消息触达任务状态 |
data.task_msg | string | 异步任务失败原因描述 |