CloudServices/Notifications/Specification/POSTOffice
< CloudServices | Notifications | Specification
The POST Office supports a very simple REST API allowing web apps to send notifications to a subscription token.
Web App Sends Notification
-
Web app sends notification to POST Office.
W: POST /1.0/notification HTTP/1.1 W: W: { "body":"{\"token\":\"T in Base 64\",...", "HMAC":"BASE64==" } P: HTTP/1.1 202 ACCEPTED - Body is a JSON serialization of
{ "token": "T in Base 64", "timestamp": ######## (in seconds UTC), // Optional, "ttl": ######## (in seconds), // Optional "ciphertext": "BASE64==", "IV": "BASE64==", } - Ciphertext is a JSON serialization encrypted with the encryption key using AES-256-CBC and base-64 encoded. The contents of the payload differ based on the type of message. For example, the payload of a standard notification will look like the following:
{ "type":"notification", "title":"...", "body":"...", "url":"http://foobar.com" }