PKU harness
CloudAPI reference

Push (planned)

Push tokens and scheduled pushes with end-to-end encrypted payloads. Planned for stage 6.

POST
/v1/push/tokens

Planned (stage 6); 501 unsupported until then. UnifiedPush (ntfy) on Android, APNs on iOS, FCM optional.

Authorization

pluginToken
headerAuthorizationBearer <token>

Token from POST /v1/auth/token (10 minutes, one device + one plugin + services). Channel owner endpoints require the token of the device and plugin that opened the channel.

Request Body

application/json
  1. body
kind*string
Value in"unifiedpush""apns""fcm"
token*string
Length1 <= length <= 2048

Response Body

Registered.

application/json
  1. response
ok*boolean
Example Request
curl -X POST 'https://cloud.example.org/v1/push/tokens' \  -H 'Content-Type: application/json' \  -d '{  "kind": "unifiedpush",  "token": "string"}'
Example Response
{  "ok": true}
POST
/v1/push/schedule

Planned (stage 6); 501 unsupported until then. The payload is an envelope: the server learns the time only. At most 100 pending schedules.

Authorization

pluginToken
headerAuthorizationBearer <token>

Token from POST /v1/auth/token (10 minutes, one device + one plugin + services). Channel owner endpoints require the token of the device and plugin that opened the channel.

Request Body

application/json
  1. body
at*Ms

Unix time in milliseconds.

Range0 <= value
payload*

XChaCha20-Poly1305 sealed JSON. n = 24-byte random nonce, c = ciphertext ‖ 16-byte tag. Open it with open() from @pku-harness/cloud-protocol and validate the result.

Response Body

The schedule id.

application/json
  1. response
id*string
Length1 <= length
Example Request
curl -X POST 'https://cloud.example.org/v1/push/schedule' \  -H 'Content-Type: application/json' \  -d '{  "at": 0,  "payload": {    "v": 1,    "n": "string",    "c": "stringstringstringstri"  }}'
Example Response
{  "id": "string"}
DELETE
/v1/push/schedule

Planned (stage 6); 501 unsupported until then.

Authorization

pluginToken
headerAuthorizationBearer <token>

Token from POST /v1/auth/token (10 minutes, one device + one plugin + services). Channel owner endpoints require the token of the device and plugin that opened the channel.

Request Body

application/json
  1. body
id*string
Length1 <= length

Response Body

Cancelled.

application/json
  1. response
ok*boolean
Example Request
curl -X DELETE 'https://cloud.example.org/v1/push/schedule' \  -H 'Content-Type: application/json' \  -d '{  "id": "string"}'
Example Response
{  "ok": true}