Step 2: Push notifications

To push notifications to the client application, run the service as follows:

java -cp .;httpclient-4.0.1.jar;apache-mime4j-0.6.jar;commons-codec-1.3.jar;commons-logging-1.1.1.jar;httpcore-4.0.1.jar;httpmime-4.0.1.jar MyService 
"payload:<Payload text>" "nid:<NID>" "application_id:<Application ID>" "service_id:<Service ID>" "service_secret:<Service Secret>"

For example:

java -cp .;httpclient-4.0.1.jar;apache-mime4j-0.6.jar;commons-codec-1.3.jar;commons-logging-1.1.1.jar;httpcore-4.0.1.jar;httpmime-4.0.1.jar MyService 
"payload:Test Notification from REST API" "nid:ny9lyJHLFFOIoAn9XHdH9zGqXGJg=" "application_id:com.example2" "service_id:example2.com" "service_secret:Wi23Rwu+PiON4/Yftc="

If the service executed successfully, the following output should be displayed in the console:

HTTP Response from Notifications API: <RESULT> Where <RESULT> is a 3-digit response code. For the list of result codes and their explanation, see the API reference.