跳至內容

iOS 即時動態的 REST API 參考

PushWard API 是一套用於即時動態、通知、小工具與電子郵件的 REST API。PushWard 透過 Apple Push Notification service(APNs)傳送到 Apple 裝置,並透過 Firebase Cloud Messaging(FCM)傳送到 Android。

Base URL

https://api.pushward.app

Authentication

All endpoints (except /health) require a Bearer token in the Authorization header:

Authorization: Bearer hlk_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345

Tokens are hlk_ integration keys created in the iOS app's settings screen — see Authentication for the key format, permissions, and slug-restriction rules.

Activity State Machine

Activities follow a state machine with two client-visible states:

StateDescription
endedInactive (default on creation)
ongoingActive Live Activity running on device

State Transitions

Transitions are triggered via PATCH /activities/{slug}:

FromToPush Action
endedongoingPush-to-start (starts Live Activity)
ongoingongoingPush update (updates content)
ongoingendedPush end (dismisses after 4 hours)
ℹ 資訊

Activities may also enter an internal preempted state when the server evicts the lowest-priority activity to stay under the ongoing limit. Clients cannot set preempted directly — patch the activity back to ongoing to restart it.

Rate limits, quotas, and the eviction rule live on the Limits page.

Endpoints

SectionDescription
AuthenticationToken management and user profile
ActivitiesCreate, list, update, and delete activities
NotificationsSend inbox notifications with optional APNs push delivery
WidgetsCreate, update, and delete Home Screen widgets
EmailSend transactional email to verified recipients