EngageLab App Push API Skill
This skill enables interaction with the EngageLab App Push REST API (MTPush). The service supports push notifications and in-app messages to Android, iOS, and HarmonyOS, with multi-vendor channel support (FCM, Huawei, Xiaomi, OPPO, vivo, Meizu, Honor, etc.).
It covers these areas:
- 1. Create Push — Send notification or message to single/multiple devices (broadcast, tag, alias, registrationid, segment)
- Batch Single Push — Batch push by registrationid or alias (up to 500 per request)
- Group Push — Push to all apps in a group
- Push Plan — Create/update/list push plans and query msgids by plan
- Scheduled Tasks — Create, get, update, delete scheduled push tasks (single, periodical, intelligent)
- Tag & Alias — Query/set/delete device tags and aliases; query tag count
- Message Recall — Recall a pushed message (within one day)
- Delete User — Delete a user (registrationid) and all associated data
- Statistics — Message lifecycle stats, report APIs
- Callback — Webhook setup and signature verification
- Test Push — Validate push request without sending
- Image API — OPPO big/small picture upload
- Push-to-Speech — Create/update voice broadcast files
Resources
scripts/
- -
push_client.py — Python client class (EngageLabPush) wrapping create push, batch push (regid/alias), device get/set/delete, tag count, message recall, validate push, push plan create/list, scheduled tasks CRUD, and message detail stats. Handles Basic auth and typed error handling. Use as a helper or import into the user's project.
references/
- -
error-codes.md — Push API error codes and descriptions http-status-code.md — HTTP status code specificationcallback-api.md — Callback address, validation, security (X-CALLBACK-ID, HMAC-SHA256)
Source API docs: doc/apppush/REST API/ (Create Push API, Batch Single Push API, Group Push API, Push Plan API, Scheduled Tasks API, Tag Alias API, Message Recall, Delete User API, Statistics API, Callback API, Test Push API, imageAPI, Push-to-Speech API, REST API OVERVIEW, HTTP Status code).
Authentication
All EngageLab App Push API calls use HTTP Basic Authentication.
- - Base URL (choose by data center):
- Singapore:
https://pushapi-sgp.engagelab.com
- Virginia, USA:
https://pushapi-usva.engagelab.com
- Frankfurt:
https://pushapi-defra.engagelab.com
- Hong Kong:
https://pushapi-hk.engagelab.com
- - Header: INLINECODE10
- Content-Type:
application/json (or multipart/form-data for Image/Push-to-Speech as specified)
Obtain AppKey and Master Secret from Console → Application Settings → Application Info.
Group Push uses a different auth: username = group- + GroupKey, password = Group Master Secret (from Group management).
Example (curl):
CODEBLOCK0
If the user hasn't provided credentials, ask for AppKey and Master Secret before generating API calls.
Request Rate Limits
- - Standard: 500 requests per second per AppKey.
- Batch Single Push shares the same QPS quota as the Push API (1 target = 1 QPS).
Quick Reference — Main Endpoints
| Operation | Method | Path |
|---|
| Create push | INLINECODE16 | INLINECODE17 |
| Batch push by registration_id |
POST |
/v4/batch/push/regid |
| Batch push by alias |
POST |
/v4/batch/push/alias |
| Group push |
POST |
/v4/grouppush |
| Create/update push plan |
POST |
/v4/push_plan |
| List push plans |
GET |
/v4/push_plan/list |
| Msg IDs by plan |
GET |
/v4/status/plan/msg/ |
| Create scheduled task |
POST |
/v4/schedules |
| Get scheduled task |
GET |
/v4/schedules/{schedule_id} |
| Update scheduled task |
PUT |
/v4/schedules/{schedule_id} |
| Delete scheduled task |
DELETE |
/v4/schedules/{schedule_id} |
| Tag count |
GET |
/v4/tags_count |
| Get device (tags/alias) |
GET |
/v4/devices/{registration_id} |
| Set device tags/alias |
POST |
/v4/devices/{registration_id} |
| Delete device (user) |
DELETE |
/v4/devices/{registration_id} |
| Message recall |
DELETE |
/v4/push/withdraw/{msg_id} |
| Message statistics |
GET |
/v4/status/detail (message_ids) |
| Test push (validate) |
POST |
/v4/push/validate |
| OPPO image upload |
POST |
/v4/image/oppo |
| Create/update voice |
POST |
/v4/voices |
| List/delete voices |
GET /
DELETE |
/v4/voices |
Create Push (POST /v4/push)
Push a notification or message to a single device or list of devices. Body is JSON.
Request structure (summary)
| Field | Type | Required | Description |
|---|
| INLINECODE60 | string | No | Sender, e.g. INLINECODE61 |
| INLINECODE62 |
string or object | Yes | Target:
"all" (broadcast), or object with
tag,
tag_and,
tag_not,
alias,
registration_id,
live_activity_id,
seg |
|
body | object | Yes | See below |
|
request_id | string | No | Client-defined request ID returned in response |
|
custom_args | object | No | Returned on callback, max 128 chars |
body
| Field | Type | Required | Description |
|---|
| INLINECODE74 | string or array | Yes | INLINECODE75 or INLINECODE76 |
| INLINECODE77 |
object | Optional* | Notification content (android, ios, hmos; alert, title, extras, etc.) |
|
message | object | Optional* | In-app/custom message (msg
content, title, contenttype, extras) |
|
live_activity | object | Optional* | iOS Live Activity (ios.event, content-state, attributes, etc.) |
|
voip | object | Optional* | iOS VoIP (key-value); cannot coexist with notification/message/live_activity |
|
options | object | No | time
tolive, apns
production, apnscollapse
id, bigpush
duration, multilanguage, third
partychannel, plan_id, cid, etc. |
*One of notification, message, live_activity, or voip must exist; they cannot coexist (except notification+message in some cases — see doc). For iOS, set options.apns_production (true/false) for environment.
Push target to examples
- - Broadcast: INLINECODE84
- Tags (OR): INLINECODE85
- Tags (AND): INLINECODE86
- Alias: INLINECODE87
- Registration IDs: INLINECODE88
- Segment: INLINECODE89
- Live Activity: INLINECODE90
Response (success)
CODEBLOCK1
For full parameter details (android/ios/hmos notification fields, options, multilanguage, thirdparty_channel, push limits per vendor), see doc/apppush/REST API/Create Push API.md. Error codes: references/error-codes.md.
Batch Single Push
- - By registration_id: INLINECODE93
- By alias: INLINECODE94
Request body: { "requests": [ { "target": "reg_id_or_alias", "platform": "android"|"ios"|"all", "notification": {...}, "message": {...}, "options": {...}, "custom_args": {...} } ] }. Max 500 items per request; target must be unique in the batch. Response returns per-target result (msg_id or error). See doc/apppush/REST API/Batch Single Push API.md.
Group Push
INLINECODE98 — Same body structure as Create Push. Auth: Basic with group-{GroupKey} and Group Master Secret. Response includes group_msgid and per-app msgid. overridemsg_id and Schedule API are not supported for group push.
Push Plan
- - Create/update:
POST /v4/push_plan — Body: { "plan_id": "xxx", "plan_description": "..." }. - List:
GET /v4/push_plan/list?page_index=1&page_size=20&send_source=0|1&search_description=xxx. - Msg IDs by plan:
GET /v4/status/plan/msg/?plan_ids=id1,id2&start_date=yyyy-MM-dd&end_date=yyyy-MM-dd (within 30 days, max 31 days span).
Use plan_id in Create Push body.options to associate a push with a plan.
Scheduled Tasks
- - Create:
POST /v4/schedules — Body includes name, enabled, trigger (single / periodical / intelligent), push (same as Create Push body). - Get:
GET /v4/schedules/{schedule_id}. - Update:
PUT /v4/schedules/{schedule_id}. - Delete:
DELETE /v4/schedules/{schedule_id}.
Trigger types: single (one-time, time, zone_type), periodical (start, end, time, timeunit, point, zonetype), intelligent (backup_time: "now" or "yyyy-MM-dd HH:mm:ss"). See doc/apppush/REST API/Scheduled Tasks API.md.
Tag & Alias
- - Tag count:
GET /v4/tags_count?tags=tag1&tags=tag2&platform=android|ios|hmos (up to 1000 tags). - Get device:
GET /v4/devices/{registration_id} — Returns tags, alias. - Set device:
POST /v4/devices/{registration_id} — Body: { "tags": { "add": ["t1"], "remove": ["t2"] }, "alias": "alias1" }.
Limits: 100,000 tags per app; 40 bytes per tag; 100 tags per device; 100,000 devices per tag; one alias per device (40 bytes). See doc/apppush/REST API/Tag Alias API.md.
Message Recall
INLINECODE127 — Recall within one day; no duplicate recall.
Delete User
INLINECODE128 — Asynchronously deletes user and all related data (tags, alias, device info, timezone). Cannot be restored. Batch deletion not supported.
Statistics
- - Message detail:
GET /v4/status/detail?message_ids=id1,id2 (up to 100 message_ids). Returns targets, sent, delivered, impressions, clicks, and sub-stats by channel. Data retained up to one month.
Other report endpoints (e.g. report APIs) are documented in doc/apppush/REST API/Statistics API.md.
Callback
Configure callback URL (via Engagelab support). Validation: server sends POST with echostr in body; respond with body = echostr value. Security: use X-CALLBACK-ID header; signature = HMAC-SHA256(secret, timestamp+nonce+username). Respond with 200/204 within 3 seconds for success. See references/callback-api.md and doc/apppush/REST API/Callback API.md.
Test Push
INLINECODE137 — Same body as Create Push. Validates request without sending to users.
Image API (OPPO)
INLINECODE138 — Body: { "big_picture_url": "url", "small_picture_url": "url" }. Returns big_picture_id, small_picture_id for use in push options (e.g. thirdpartychannel.oppo). OPPO constraints: big 984×369, ≤1MB; small 144×144, ≤50KB; PNG/JPG/JPEG.
Push-to-Speech
- - Create/update:
POST /v4/voices — Content-Type: multipart/form-data; fields: language (en, zh-Hans, zh-Hant), file (zip of mp3 files). Returns file_url. - List:
GET /v4/voices. - Delete:
DELETE /v4/voices?language=en.
Use options.voice_value in push body to reference voice for TTS. See doc/apppush/REST API/Push-to-Speech API.md.
Generating Code
When the user asks to send push or use other App Push APIs, generate working code. Default to curl unless the user specifies a language. Supported patterns:
- - curl — Shell with
-u "AppKey:MasterSecret" and correct base URL - Python —
requests with Basic auth - Node.js —
fetch or INLINECODE154 - Java — INLINECODE155
- Go — INLINECODE156
Always include the Authorization header and error handling. Use placeholders like YOUR_APP_KEY and YOUR_MASTER_SECRET if credentials are not provided.
Python Example — Create Push
CODEBLOCK2
技能名称: engagelab-apppush
详细描述:
EngageLab App Push API 技能
该技能支持与 EngageLab App Push REST API(MTPush)进行交互。服务支持向 Android、iOS 和 HarmonyOS 发送推送通知和应用内消息,并支持多厂商通道(FCM、华为、小米、OPPO、vivo、魅族、荣耀等)。
涵盖以下领域:
- 1. 创建推送 — 向单个/多个设备发送通知或消息(广播、标签、别名、注册ID、分群)
- 批量单推 — 按注册ID或别名批量推送(每次请求最多500个)
- 群组推送 — 向群组内所有应用推送
- 推送计划 — 创建/更新/列出推送计划,并按计划查询消息ID
- 定时任务 — 创建、获取、更新、删除定时推送任务(单次、周期、智能)
- 标签与别名 — 查询/设置/删除设备标签和别名;查询标签数量
- 消息撤回 — 撤回已推送的消息(一天内)
- 删除用户 — 删除用户(注册ID)及其所有关联数据
- 统计 — 消息生命周期统计、报告API
- 回调 — Webhook设置与签名验证
- 测试推送 — 验证推送请求但不实际发送
- 图片API — OPPO大/小图片上传
- 语音推送 — 创建/更新语音广播文件
资源
scripts/
- - push_client.py — Python客户端类(EngageLabPush),封装了创建推送、批量推送(注册ID/别名)、设备获取/设置/删除、标签数量、消息撤回、验证推送、推送计划创建/列出、定时任务增删改查以及消息详情统计。处理基本认证和类型化错误处理。可作为辅助工具使用或导入用户项目。
references/
- - error-codes.md — 推送API错误码及描述
- http-status-code.md — HTTP状态码规范
- callback-api.md — 回调地址、验证、安全性(X-CALLBACK-ID、HMAC-SHA256)
源API文档:doc/apppush/REST API/(创建推送API、批量单推API、群组推送API、推送计划API、定时任务API、标签别名API、消息撤回、删除用户API、统计API、回调API、测试推送API、图片API、语音推送API、REST API概述、HTTP状态码)。
认证
所有EngageLab App Push API调用均使用HTTP基本认证。
- 新加坡:https://pushapi-sgp.engagelab.com
- 美国弗吉尼亚:https://pushapi-usva.engagelab.com
- 法兰克福:https://pushapi-defra.engagelab.com
- 香港:https://pushapi-hk.engagelab.com
- - 请求头:Authorization: Basic base64(appKey:masterSecret)
- 内容类型:application/json(图片/语音推送按规范使用multipart/form-data)
从控制台 → 应用设置 → 应用信息获取AppKey和Master Secret。
群组推送使用不同认证:username = group- + GroupKey,password = 群组Master Secret(来自群组管理)。
示例(curl):
bash
curl -X POST https://pushapi-sgp.engagelab.com/v4/push \
-H Content-Type: application/json \
-u YOURAPPKEY:YOURMASTERSECRET \
-d { from: push, to: all, body: { platform: all, notification: { alert: Hello! } } }
如果用户未提供凭据,在生成API调用前请询问AppKey和Master Secret。
请求速率限制
- - 标准:每个AppKey每秒500次请求。
- 批量单推与推送API共享相同QPS配额(1个目标 = 1 QPS)。
快速参考 — 主要端点
| 操作 | 方法 | 路径 |
|-----------|--------|------|
| 创建推送 | POST | /v4/push |
| 按注册ID批量推送 | POST | /v4/batch/push/regid |
| 按别名批量推送 | POST | /v4/batch/push/alias |
| 群组推送 | POST | /v4/grouppush |
| 创建/更新推送计划 | POST | /v4/push_plan |
| 列出推送计划 | GET | /v4/push_plan/list |
| 按计划查询消息ID | GET | /v4/status/plan/msg/ |
| 创建定时任务 | POST | /v4/schedules |
| 获取定时任务 | GET | /v4/schedules/{schedule_id} |
| 更新定时任务 | PUT | /v4/schedules/{schedule_id} |
| 删除定时任务 | DELETE | /v4/schedules/{schedule_id} |
| 标签数量 | GET | /v4/tags_count |
| 获取设备(标签/别名) | GET | /v4/devices/{registration_id} |
| 设置设备标签/别名 | POST | /v4/devices/{registration_id} |
| 删除设备(用户) | DELETE | /v4/devices/{registration_id} |
| 消息撤回 | DELETE | /v4/push/withdraw/{msg_id} |
| 消息统计 | GET | /v4/status/detail(message_ids) |
| 测试推送(验证) | POST | /v4/push/validate |
| OPPO图片上传 | POST | /v4/image/oppo |
| 创建/更新语音 | POST | /v4/voices |
| 列出/删除语音 | GET / DELETE | /v4/voices |
创建推送(POST /v4/push)
向单个设备或设备列表推送通知或消息。请求体为JSON格式。
请求结构(概要)
| 字段 | 类型 | 必填 | 描述 |
|-------|------|----------|-------------|
| from | 字符串 | 否 | 发送者,例如push |
| to | 字符串或对象 | 是 | 目标:all(广播),或包含tag、tagand、tagnot、alias、registrationid、liveactivity_id、seg的对象 |
| body | 对象 | 是 | 见下方 |
| request_id | 字符串 | 否 | 客户端定义的请求ID,在响应中返回 |
| custom_args | 对象 | 否 | 回调时返回,最多128字符 |
body
| 字段 | 类型 | 必填 | 描述 |
|-------|------|----------|-------------|
| platform | 字符串或数组 | 是 | all或[android,ios,hmos] |
| notification | 对象 | 可选* | 通知内容(android、ios、hmos;alert、title、extras等) |
| message | 对象 | 可选* | 应用内/自定义消息(msgcontent、title、contenttype、extras) |
| live_activity | 对象 | 可选* | iOS实时活动(ios.event、content-state、attributes等) |
| voip | 对象 | 可选* | iOS VoIP(键值对);不能与notification/message/live_activity共存 |
| options | 对象 | 否 | timetolive、apnsproduction、apnscollapseid、bigpushduration、multilanguage、thirdpartychannel、plan_id、cid等 |
*notification、message、liveactivity或voip中必须存在一个;它们不能共存(某些情况下notification+message除外——参见文档)。对于iOS,设置options.apnsproduction(true/false)以指定环境。
推送目标to示例
- - 广播:to: all
- 标签(OR):to: { tag: [Shenzhen,Gu