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) |
javax.ws.rs.core.Response |
crossOriginForInstallations(javax.ws.rs.core.HttpHeaders headers,
String token) |
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 |
registerInstallation(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)
public javax.ws.rs.core.Response crossOriginForInstallations(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response registerInstallation(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"
-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!public 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}
public 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",
...
},
...
]
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.