RESTful API for sending Push Notifications.
The Endpoint is protected using HTTP Basic (credentials PushApplicationID:masterSecret ).
Messages are submitted as flexible JSON maps, like:
curl -u "PushApplicationID:MasterSecret"
-v -H "Accept: application/json" -H "Content-type: application/json"
-X POST
-d '{
"alias" : ["someUsername"],
"deviceType" : ["someDevice"],
"categories" : ["someCategories"],
"variants" : ["someVariantIDs"],
"ttl" : 3600,
"message":
{
"key":"value",
"key2":"other value",
"alert":"HELLO!",
"action-category":"some value",
"sound":"default",
"badge":2,
"content-available" : true
},
"simple-push":"version=123"
}'
https://SERVER:PORT/CONTEXT/rest/sender
Details about the Message Format can be found HERE!- Input:
- Map<String,Object>
- Output:
- javax.ws.rs.core.Response
- Consumes:
- application/json
- HTTP return codes:
- 200 - (OK) Indicates the Job has been accepted and is being process by the AeroGear UnifiedPush Server.
- 401 - (Unauthorized) The request requires authentication.
- 404 - (Not Found) The requested PushApplication resource does not exist.
- HTTP request headers:
- aerogear-sender - The header to identify the used client. If the header is not present, the standard "user-agent" header is used.
|