Java

The example service is a Java application that, when executed, uses command-line parameters to construct an HTTP Post request to the Notification Server through the Notifications REST API. The Notification Server will then push the notification to the appropriate client application.

The example service expects the following command-line parameters to send a notification:

  • Service ID in the form "service_id:my_service_ID";

    for example, "service_id:example.com"

  • Service Secret in the form "service_secret:my_service_secret";

    for example, "service_secret:WcbOlf05YCSyy0d4I9nBHSkE+vXRGJxjw90E/KpXLJ0="

  • Payload in the form "payload:text of the notification";

    for example, "payload:Test notification from REST API"

    and either:

    • the application ID in the form "application_id:my_application_ID"

      or

    • the Notification ID in the form "nid:NOTIFICATION_ID"

An optional parameter is also available to send multiple notifications to the client. By default, a single notification is sent to the client application.

To send more than one notification, set parameter count to the number of notifications to send;

for example, count:3.

Download the Java service example — MyService.java from NNAServiceExample.zip