当前位置: 首页 > Skill >

EngageLab App Push

EngageLab App Push

EngageLab App Push

调用 EngageLab App Push RESTAPI,向 Android、iOS、HarmonyOS 设备发送推送通知和应用内消息;管理标签和别名;创建定时推送任务。

1.0.1 2026.11.13 692
获取Skill文件查看使用说明
作 者:顾舟 许可证: 更新时间:2026.11.13
本文目录展开

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, registration_id, segment)
  2. Batch Single Push — Batch push by registration_id or alias (up to 500 per request)
  3. Group Push — Push to all apps in a group
  4. Push Plan — Create/update/list push plans and query msg_ids by plan
  5. Scheduled Tasks — Create, get, update, delete scheduled push tasks (single, periodical, intelligent)
  6. Tag & Alias — Query/set/delete device tags and aliases; query tag count
  7. Message Recall — Recall a pushed message (within one day)
  8. Delete User — Delete a user (registration_id) and all associated data
  9. Statistics — Message lifecycle stats, report APIs
  10. Callback — Webhook setup and signature verification
  11. Test Push — Validate push request without sending
  12. Image API — OPPO big/small picture upload
  13. 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 specification
  • callback-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: Authorization: Basic base64(appKey:masterSecret)
  • 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):

curl -X POST https://pushapi-sgp.engagelab.com/v4/push 
  -H "Content-Type: application/json" 
  -u "YOUR_APP_KEY:YOUR_MASTER_SECRET" 
  -d '{ "from": "push", "to": "all", "body": { "platform": "all", "notification": { "alert": "Hello!" } } }'

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 POST /v4/push
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
from string No Sender, e.g. "push"
to 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
platform string or array Yes "all" or ["android","ios","hmos"]
notification object Optional* Notification content (android, ios, hmos; alert, title, extras, etc.)
message object Optional* In-app/custom message (msg_content, title, content_type, 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_to_live, apns_production, apns_collapse_id, big_push_duration, multi_language, third_party_channel, 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: "to": "all"
  • Tags (OR): "to": { "tag": ["Shenzhen","Guangzhou"] }
  • Tags (AND): "to": { "tag_and": ["female","members"] }
  • Alias: "to": { "alias": ["user1","user2"] }
  • Registration IDs: "to": { "registration_id": ["id1","id2"] }
  • Segment: "to": { "seg": { "id": "segid" } }
  • Live Activity: "to": { "live_activity_id": "LiveActivity-1" }

Response (success)

{ "request_id": "12345678", "msg_id": "1828256757" }

For full parameter details (android/ios/hmos notification fields, options, multi_language, third_party_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: POST /v4/batch/push/regid
  • By alias: POST /v4/batch/push/alias

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

POST /v4/grouppush — Same body structure as Create Push. Auth: Basic with group-{GroupKey} and Group Master Secret. Response includes group_msgid and per-app msg_id. override_msg_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, time_unit, point, zone_type), 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

DELETE /v4/push/withdraw/{msg_id} — Recall within one day; no duplicate recall.

Delete User

DELETE /v4/devices/{registration_id} — 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

POST /v4/push/validate — Same body as Create Push. Validates request without sending to users.

Image API (OPPO)

POST /v4/image/oppo — Body: { "big_picture_url": "url", "small_picture_url": "url" }. Returns big_picture_id, small_picture_id for use in push options (e.g. third_party_channel.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 axios
  • Java — HttpClient
  • Go — net/http

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

import requests

APP_KEY = "YOUR_APP_KEY"
MASTER_SECRET = "YOUR_MASTER_SECRET"
BASE_URL = "https://pushapi-sgp.engagelab.com"

resp = requests.post(
    f"{BASE_URL}/v4/push",
    auth=(APP_KEY, MASTER_SECRET),
    headers={"Content-Type": "application/json"},
    json={
        "from": "push",
        "to": "all",
        "body": {
            "platform": "all",
            "notification": {
                "alert": "Hello, Push!",
                "android": {"alert": "Hi, Android!", "title": "Title"},
                "ios": {"alert": "Hi, iOS!", "sound": "default", "badge": "+1"},
            },
            "options": {"time_to_live": 86400, "apns_production": False},
        },
        "request_id": "req_001",
    },
)
result = resp.json()
if resp.status_code == 200:
    print("msg_id:", result.get("msg_id"))
else:
    print("Error:", result.get("error"))

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,017
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,005
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,003
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,002
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,002
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,001
Skill 文件
  • SKILL.md
    • EngageLab App Push API Skill
    • Resources
      • scripts/
      • references/
    • Authentication
    • Request Rate Limits
    • Quick Reference — Main Endpoints
    • Create Push (POST /v4/push)
      • Request structure (summary)
      • body
      • Push target to examples
      • Response (success)
    • Batch Single Push
    • Group Push
    • Push Plan
    • Scheduled Tasks
    • Tag & Alias
    • Message Recall
    • Delete User
    • Statistics
    • Callback
    • Test Push
    • Image API (OPPO)
    • Push-to-Speech
    • Generating Code
      • Python Example — Create Push
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期