Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column
width50%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleIn the section:borderStylesolid
Table of Contents



 
Column


APNS(iOS), C2DN (Android), etc. notification systems are in use.

deviceid – device token (APNs), registration id (C2DN), etc.;

username userparam – login. The field can be blank.

...

When the app connects to service, the APNS messages subscription is performed. When So when the app is closed, the notifications are still receiveddevice will receive events notifications.

POST 

http://example.com:[port][/somecontext]web2/secure/subscription/

Sample of response:

XML

Content-Type  :  application/xml

<subscription>
    <username>johndoe<username>
    <deviceid>somedeviceid</deviceid>
</subscription>

JSON

Reply with “201 Created” code means that subscribing is performed successfully.

Code 400 means that specified parameters are invalid (deviceId is not to be empty, it's length should be from 5 to 150 symbols and contain only digits and letter of English alphabet).

The POST body should contain information about created subscribing. Only JSON format is received. It's required to specify the Content-Type title properly.


Sample of request:

JSON

Content-Type  Content-Type :  application/json

{
    "usernameuserparam" : "johndoe",
    "deviceid" : "somedeviceid"

...

  • The user subscribed to events from other device;
  • Device token or registration id is changed;
  • Another user subscribed to events from this device;  
  • Subscription is cancelled manually.

DELETE 

http://example.com:[port]/web2/secure/subscription/[deviceId]

Reply with “204 No Content” code means that subscribing is performed successfully.

APN message format

{

"aps" : {

...