Start of change

Send a notification from a z/OSMF task, when the content is the message from the bundle file

This operation is used to send a notification from a z/OSMF task and the content of the notification is the message from the bundle file.

HTTP method and URI path

POST /zosmf/notifications/new

Query Parameters

None

Description

The content of the notification contains the message from the bundle file. This operation supports application linking from the notification task to the receiver task. The destination of a notification will depend on user preferences.

Request Content

A notification is sent from a z/OSMF task. The content should include the message ID and the message text, which originate from a bundle file. In this case the value of the post body should be JSON Object-like. See Table 1.

Table 1. Request content for the send notification request
Input Description Type Required or Optional
pluginId ID of the plug-in where the notification is initiated. String Required
taskId ID of the task where the notification is initiated. String Required
assignees User IDs of all recipients. String Required
descriptionBundleURL Bundle file where the description of the notification can be found. String Required
descriptionId Message ID of the description. String Required
defaultDescription Default description of the notification. String Required
descriptionParms Parameters that substitute the description. String Optional
appLinkEventId Event ID for an application event. String Optional
appLinkParms Map of the parameters, which are sent with an event. String Optional

Response Content

On completion, the request returns a JSON object with details about the notification. The response content is shown in Table 2.

Table 2. Response content for the send notification request
Field Type Description
apiVersion String The version of the Notification Services API.
result JSONObject Contains all of the output for each notification destination. It includes 1-3 keys depending on how many destinations the notification is sent to. Each key represents one destination, and its value is a JSONObject which might have messages and return codes.

Authorization Requirements

Use of the Notification RESTful services API requires the client to be authenticated. For information about client authentication in z/OSMF. See Authenticating to z/OSMF.

You will also need SAF authority, as described in Appendix A in IBM z/OS Management Facility Configuration Guide

HTTP status codes

On successful completion, HTTP status code 200 OK is returned and the response body is provided, Table 2.

The HTTP status codes and error handling are described in Error handling.

Escaping special characters

The format of a notification should be a valid JSONObject. If a special character exists it must be escaped. If " exists, it needs to be escaped as \". If \ exists, it needs to be escaped as \\.

Example HTTP interaction

Request

POST /zosmf/notifications/new
{  "pluginId": "workflow",
   "taskId": "Workflows", 
   "assignees": "zmfuser, zosmfad, z/OSMF Administrators",
   "descriptionBundleURL": "/zosmf/workflow/js/zosmf/", 
   "descriptionId": "IZUWF0039I",
   "defaultDescription": "This is a default description.",
   "applLinkId": "IBM.ZOSMF.WORKFLOWS.CREATE_WORKFLOW",
   "appLinkParams": {"workflow_name": "new workflow"}
data:{
  "event":  { 
        "dte":  "15/12/31",
        "tme":  "04:29:57",
        "sys":  "SYS1", 
        "cat":  "2", 
        "col":  "red", 
        "msg":  "event 1 (of event list)", 
        "lng":  "long message", 
        "viw":  {"workflows":{"key":"13309779173140.992077"}}
             }
      }
  }

Response

{"apiVersion":"1.0",
"result":{"mail":{"messages":null,
"rc":"Ok"},
"notification":{"messages":null}}}
}

End of change