public class InstallationRegistrationEndpoint extends AbstractBaseEndpoint
| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Constructor and Description |
|---|
InstallationRegistrationEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
crossOriginForInstallations(javax.ws.rs.core.HttpHeaders headers)
Cross Origin for Installations
|
javax.ws.rs.core.Response |
crossOriginForInstallations(javax.ws.rs.core.HttpHeaders headers,
String token)
Cross Origin for Installations
|
javax.ws.rs.core.Response |
importDevice(ImporterForm form,
javax.servlet.http.HttpServletRequest request)
API for uploading JSON file to allow massive device registration (aka import).
|
javax.ws.rs.core.Response |
increasePushMessageReadCounter(String pushMessageId,
javax.servlet.http.HttpServletRequest request)
RESTful API for Push Notification metrics registration.
|
javax.ws.rs.core.Response |
registerInstallation(String oldToken,
org.jboss.aerogear.unifiedpush.api.Installation entity,
javax.servlet.http.HttpServletRequest request)
RESTful API for Device registration.
|
javax.ws.rs.core.Response |
unregisterInstallations(String token,
javax.servlet.http.HttpServletRequest request)
RESTful API for Device unregistration.
|
createBadRequestResponse, getSearch, validateModelClasspublic javax.ws.rs.core.Response crossOriginForInstallations(@Context
javax.ws.rs.core.HttpHeaders headers,
String token)
headers - "Origin" headertoken - tokenpublic javax.ws.rs.core.Response crossOriginForInstallations(@Context
javax.ws.rs.core.HttpHeaders headers)
headers - "Origin" headerpublic javax.ws.rs.core.Response registerInstallation(@HeaderParam(value="x-ag-old-token")
String oldToken,
org.jboss.aerogear.unifiedpush.api.Installation entity,
@Context
javax.servlet.http.HttpServletRequest request)
HTTP Basic (credentials VariantID:secret).
curl -u "variantID:secret"
-v -H "Accept: application/json" -H "Content-type: application/json" -H "aerogear-push-id: someid"
-X POST
-d '{
"deviceToken" : "someTokenString",
"deviceType" : "iPad",
"operatingSystem" : "iOS",
"osVersion" : "6.1.2",
"alias" : "someUsername or email adress...",
"categories" : ["football", "sport"]
}'
https://SERVER:PORT/context/rest/registry/device
Details about JSON format can be found HERE!oldToken - The previously registered deviceToken or an empty String. Provided by the header x-ag-old-token.entity - Installation for Device registrationrequest - the request objectInstallationpublic javax.ws.rs.core.Response increasePushMessageReadCounter(String pushMessageId, @Context javax.servlet.http.HttpServletRequest request)
HTTP Basic (credentials VariantID:secret).
curl -u "variantID:secret"
-v -H "Accept: application/json" -H "Content-type: application/json" -H "aerogear-push-id: someid"
-X PUT
https://SERVER:PORT/context/rest/registry/device/pushMessage/{pushMessageId}
pushMessageId - push message identifierrequest - the requestpublic javax.ws.rs.core.Response unregisterInstallations(String token, @Context javax.servlet.http.HttpServletRequest request)
HTTP Basic (credentials VariantID:secret).
curl -u "variantID:secret"
-v -H "Accept: application/json" -H "Content-type: application/json"
-X DELETE
https://SERVER:PORT/context/rest/registry/device/{token}
token - device tokenrequest - the requestpublic javax.ws.rs.core.Response importDevice(ImporterForm form, @Context javax.servlet.http.HttpServletRequest request)
HTTP Basic (credentials VariantID:secret).
curl -u "variantID:secret" -v -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "file=@/path/to/my-devices-for-import.json" -X POST https://SERVER:PORT/context/rest/registry/device/importerThe format of the JSON file is an array, containing several objects that follow the same syntax used on the
/rest/registry/device endpoint.
Here is an example:
[
{
"deviceToken" : "someTokenString",
"deviceType" : "iPad",
"operatingSystem" : "iOS",
"osVersion" : "6.1.2",
"alias" : "someUsername or email adress...",
"categories" : ["football", "sport"]
},
{
"deviceToken" : "someOtherTokenString",
...
},
...
]
form - JSON file to importrequest - the requestCopyright © 2017 JBoss by Red Hat. All rights reserved.