# 创建红包模板
请求方式:POST
请求地址:https://$basehost/gateway/eaopen/AddRedPacketTemplate
body参数:
{
"robot_id": "机器人id",
"template": {
"title": "标题",
"amount": "红包金额,单位:分 int",
"receiver_type": "2:私聊红包, 3:群发红包",
"detail": {
"logo_url" : "logo",
"cover_url" : "封面",
"red_packet_subject": "红包标题,发送者名称",
"red_packet_note": "红包留言,祝福语"
}
}
}
字段 | 类型 | 必填 | 说明 |
---|---|---|---|
robot_id | string | 是 | 机器人id |
title | string | 是 | 标题 |
amount | int | 是 | 红包金额,单位:分 int |
receiver_type | int | 是 | 2:私聊红包, 3:群发红包 |
logo_url | string | 否 | logo |
cover_url | string | 否 | 封面 |
red_packet_subject | string | 否 | 红包标题 |
red_packet_note | string | 否 | 红包留言,祝福语 |
返回值:
{
"data": {
"template": {
"id": "2222",
"title": "标题",
"amount": "红包金额,单位:分 int",
"receiver_type": "2:私聊红包, 3:群发红包",
"creator_name": "创建者名称",
"detail": {
"logo_url" : "logo",
"cover_url" : "封面",
"red_packet_subject": "红包标题",
"red_packet_note": "红包留言,祝福语"
}
}
},
"errcode": 0,
"errmsg": "",
"hint": ""
}
返回说明
字段 | 类型 | 说明 |
---|---|---|
errcode | int | 状态码,0为正常,非0代表错误 |
errmsg | string | 错误信息 |
data | json | json返回值 |
template | json | 模板数据 |
id | string | 红包模板id |
title | string | 标题 |
amount | int | 红包金额,单位:分 int |
receiver_type | int | 2:私聊红包, 3:群发红包 |
creator_name | string | 创建者名称 |
detail | json | 红包信息 |
logo_url | string | logo |
cover_url | string | 封面 |
red_packet_subject | string | 红包标题 |
red_packet_note | string | 红包留言,祝福语 |
hint | string | 请求日志ID |
完整请求示例:
curl -X POST https://$basehost/gateway/qopen/UpdatePointsAccount \
-H 'Content-Type: application/json; charset=UTF-8' \
-H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
-d '{
"robot_id": "acc7iFXXXXOmTUu0Dy2wEi",
"template": {
"title":"接口红包模板",
"amount": 77,
"receiver_type": 2,
"detail": {
"logo_url": "https://www.baidu.com/",
"cover_url": "https://www.baidu.com/",
"red_packet_subject": "标题",
"red_packet_note": "祝福语"
}
}
}'
← 渠道活码管理相关接口 查询红包模板 →