EMS Installations Resource

From RAD Studio
Jump to: navigation, search

Go Up to EMS Administrative API


The EMS database stores data about registered devices of an EMS Push Notifications application. You can access this information by using the registered Installations Resource.

You can send EMS Push Notifications to the EMS Installations (registered devices) by using the EMS Management Console Application.

Note: Use the TEMSClientAPI and the TCustomPushEvents components to register a new device (EMS Installation) and get data from the EMS Installations Resource.

Installations Resource Endpoints

Installations Resource exposes the following EMS Resource Endpoints:

Endpoint Method Name Resource Suffix HTTP Request Type Use

GetInstallations

--

HTTP GET

To retrieve all data from Installations Resource.

GetChannels

channels

HTTP GET

To retrieve the available channels to which the device is subscribed.

GetInstallationFields

fields

HTTP GET

To retrieve the field names of all EMS Installations.

GetInstallation

{id}

HTTP GET

To retrieve all data from a specific installation (registered device).
id is the unique EMS Installation identifier in the EMS database.

AddInstallation

--

HTTP POST

To add a new EMS Installation to the EMS database.

UpdateInstallation

{id}

HTTP PUT

To update the EMS Installation fields in the EMS database.
id is the unique EMS Installation identifier in the EMS database.

DeleteInstallation

{id}

HTTP DELETE

To delete an Installation from the EMS database.
id is the unique EMS Installation identifier in the EMS database.

GetInstallations Endpoint

Returns a list of EMS Installation data.

Use the QueryInstallations method to retrieve the list of EMS Installations.

If successful, the response from the EMS server provides a list of all EMS Installations with details about each one of them.

  • _id
  • deviceToken
  • deviceType
  • _meta (creator, created and updated fields)
  • channels
  • Custom fields (optional)

Example Response

This is an example response:

[  
   {  
      "_id":"384234D0-7CEC-4C29-8363-2CED46ACAD39",
      "deviceToken":"APA91bEIMc7Q8mhbGW8hJM44y5oOU3x-zAlJ37W_NThA1HOZeZY9AmMkziY-Ri-REh1m-Qa8Dw2paBDTwXXZNrY1qa8nAFQGjXYaiS_5hiJ3cZDL7OB1zkcya4JoJCpUccmvm49yXHmcqBKC32rk23PKib8ZYyBmX_wgZhwM_vBozhKJ821wXDI",
      "deviceType":"android",
      "_meta":{  
         "creator":"00000000-0000-0000-0000-000000000000",
         "created":"2015-02-06T10:05:01.000Z",
         "updated":"2015-02-06T10:06:34.000Z"
      },
      "description":"Nexus 7 device.",
      "channels":[  
         "News"
      ]
   },
   {  
      "_id":"92690E39-889C-4CC1-9B54-404ABB0604A3",
      "deviceToken":"APA91bG5a4a4HMACivEP2hH-x_7PUIW8GT4lvdHQWGfnh0KB7lRTwDMyS-2cHqw4gJGj_kSTXHt6DRiuA5Zr_26d1la83nlUfBuPUPXfq_8IAuQBH7thf22_X9RWCJbbcj27OEkUx0u5ylno-RTOFR1rTicxkBai6sYqPLzmvJeySwyDdyQnk9o",
      "deviceType":"android",
      "_meta":{  
         "creator":"00000000-0000-0000-0000-000000000000",
         "created":"2015-02-06T10:55:03.000Z"
      },
      "channels":[  

      ]
   }
]

GetChannels Endpoint

Returns a list the available channels to which the device is subscribed.

Use the RetrieveInstallationsChannelNames method to retrieve the list of available channels.

If successful, the response from the EMS server provides a list of all available channels.

Example Response

This is an example response:

[  
   "News",
   "Weather"
]

GetFields Endpoint

Retrieves the field names of all EMS Installations from the EMS database.

Use the RetrieveInstallationsFields method to retrieve the field names of all EMS Installations.

If successful, the response from the EMS server provides all the field names of the EMS Installation.

  • _id
  • deviceToken
  • deviceType
  • _meta (creator, created and updated fields)
  • channels
  • Custom fields (optional)

Example Response

This is an example response:

[  
   {  
      "name":"_id"
   },
   {  
      "name":"deviceToken"
   },
   {  
      "name":"deviceType"
   },
   {  
      "name":"_meta",
      "fields":[  
         {  
            "name":"creator"
         },
         {  
            "name":"created"
         },
         {  
            "name":"updated"
         }
      ]
   },
   {  
      "name":"channels"
   },
   {  
      "name":"description",
      "custom":true
   }
]

GetInstallation Endpoint

Retrieves all data from a given EMS Installation (identified by the id).

Your request must provide at least the following field:

  • _id

Use the RetrieveInstallations method to retrieve the fields of an EMS Installations.

If successful, the response from the EMS server provides all the field names of the EMS Installation.

  • _id
  • deviceToken
  • deviceType
  • _meta (creator, created and updated fields)
  • channels
  • Custom fields (optional)

Example Response

This is an example response for the EMS Installation id "384234D0-7CEC-4C29-8363-2CED46ACAD39"

{  
   "_id":"384234D0-7CEC-4C29-8363-2CED46ACAD39",
   "deviceToken":"APA91bEIMc7Q8mhbGW8hJM44y5oOU3x-zAlJ37W_NThA1HOZeZY9AmMkziY-Ri-REh1m-Qa8Dw2paBDTwXXZNrY1qa8nAFQGjXYaiS_5hiJ3cZDL7OB1zkcya4JoJCpUccmvm49yXHmcqBKC32rk23PKib8ZYyBmX_wgZhwM_vBozhKJ821wXDI",
   "deviceType":"android",
   "_meta":{  
      "creator":"00000000-0000-0000-0000-000000000000",
      "created":"2015-02-06T10:05:01.000Z",
      "updated":"2015-02-06T11:58:57.000Z"
   },
   "description":"Nexus 7 device",
   "channels":[  
      "News",
      "Weather"
   ]
}

AddInstallation Endpoint

Adds a new installation (registered device) to the EMS database.

Use the RegisterDevice method to register a new EMS Installation.

UpdateInstallation Endpoint

Updates the data of an existing EMS Installation that is stored in the EMS database.

Your request must provide at least the following field:

  • _id

Use the UpdateInstallation method to update the data of an existing EMS Installation.

DeleteInstallation Endpoint

Deletes an existing EMS Installation from the EMS database.

Your request must provide the following field:

  • _id

Use the DeleteInstallation method to delete an existing EMS Group.

EMS Installations Fields

Installations resource in EMS request and responses may include any combination of the following fields:

Item Example Description
"_id"
"384234D0-7CEC-4C29-8363-2CED46ACAD39"

Unique EMS Installation identifier in the EMS database.

"deviceToken"
"APA91bEIMc7Q8mhbGW8hJM44y5oOU3x-zAlJ37W[...]vBozhKJ821wXDI"

Unique EMS Installation identifier in the EMS database.

"deviceType"
"android"

Type of the device (ios, android, winrt, winphone, dotnet).

"_meta"
{
    "creator":"00000000-0000-0000-0000-000000000000",
    "created":"2015-02-06T10:05:01.000Z",
    "updated":"2015-02-06T10:06:34.000Z"
}
  • creator: EMS Installation creator in the EMS database.
  • created: Creation time of the EMS Installation.
  • updated: Time when the EMS Installation has been updated.
"channels"
[
    "News",
    "Weather"
]

List of available channels to which the device is subscribed.

Custom fields

"myCustomField": "My Custom Field description"

Additional stored information for the EMS Installation.

See Also