You need to enable JavaScript to run this app.
文档中心
增长营销平台

增长营销平台

复制全文
下载 pdf
任务管理
创建任务
复制全文
下载 pdf
创建任务

任务创建为异步创建,本文介绍创建任务相关的两个接口:发起异步任务创建、查询异步任务结果。

发起异步任务创建

基本信息

  • 接口path:/gmp/openapi/v1/task/add_async_task
  • 请求方式:POST、application/json

请求参数

参数

类型

是否必填

描述

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

是

人群类型

  • 4:全部
  • 2:指定人群

finder_app_id

int64

是

finder 应用 ID

group_info

list

否

多级分组 ID 路径

trigger_config

参数

类型

是否必填

描述

finish_a_config

object

是

触发 a 类型配置,参数详情请参见下文finish_a_config

finish_a_config

参数

类型

是否必填

描述

start_time

int64

是

开始时间

end_time

int64

是

结束时间

final_end_time

int64

是

最终结束时间

finish_times

int64

是

完成次数

type

int64

是

完成类型:每次,一次

event_as

list

是

事件配置,参数详情请参见下文event_as

event_as

参数

类型

是否必填

描述

event

string

是

某一个时间的唯一标识

condition

int64

是

条件的且或逻辑

filter_condition_list

list

否

事件属性条件配置,参数详情请参见下文filter_condition_list

filter_condition_list

参数

类型

是否必填

描述

condition_name

string

否

事件属性唯一标识

condition_type

string

否

属性条件类型

condition_value

string

否

属性条件值

value_type

int64

否

属性类型

channel_config

参数

类型

是否必填

描述

global_frequency_ctr

boolean

是

全局频控

channel_basic_send_content_config

object

是

通道内容设置,参数详情请参见下文channel_basic_send_content_config

channel_basic_send_content_config

参数

类型

是否必填

描述

webhook_b_content

object

否

webhook 内容配置,参数详情请参见下文webhook_b_content

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

查询异步任务结果

基本信息

  • 接口 path:/gmp/openapi/v1/task/get_async_task
  • 请求方式:GET、application/json

请求参数

参数

类型

是否必填

描述

project_id

int64

是

项目 ID

asyn_task_id

int64

是

提交的异步任务 ID

响应参数

参数

类型

描述

code

int32

错误码,正常返回 0

data

object

查询的任务列表

msg

string

结果信息

log_id

string

trace

data.status

int64

异步任务完成状态

运行中        BatchTaskStatus = 1
创建异步任务结束           BatchTaskStatus = 20
已删除         BatchTaskStatus = 30
已取消         BatchTaskStatus = 40
审批异步任务结束 BatchTaskStatus = 50

data.task_id

int64

消息触达任务 ID

data.task_status

int64

消息触达任务状态

data.task_msg

string

异步任务失败原因描述

最近更新时间:2026.08.25 14:21:25
这个页面对您有帮助吗?
有用
有用
无用
无用