Send a notification from a third party product
This operation is used to send a notification from a third party product. .
HTTP method and URI path
POST /zosmf/notifications/new
Query Parameters
None
Description
A notification with the same content, which is specified by the element data, is sent to all of the devices that are retrieved by the elements: product and eventGroup. This operation does not support application linking. Mail with the same subject and content will be sent to all recipients. If the “attachment” parameter is specified, the attachment will only appear in the recipients' mail.
Request Content
The value of the post body should be JSON Object-like. See Table 1.
Input | Description | Type | Required or Optional |
---|---|---|---|
subject | Subject of the notification. The allowable length is 1-500. | String | Required |
content | Notification body. The allowable length is 0-5000. | String | Optional |
attachment | File path of the attachment. | String | Optional |
product | Product of Mapping. | String | Required, only if the notification is from a third party product. |
eventGroup | Event group of Mapping. | String | Required |
data | Payload content of a notification. | JSON String | Required, only if the notification is from a third party product. |
alert | Displayed on APP in the systems that support the alert function. | 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.
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. See 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
{
"subject": "to zosmfad 1012",
"content": "1012-1",
"eventGroup": "Info",
"product": "MPF",
"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",
"tok": "",
"cmd": ""
}
}
}
Response
{"apiVersion":"1.0",
"result":{
"mobile":{"messages":null,"rc":"Ok"},
"mail":{"messages":null,"rc":"Ok"},
"notification":{"messages":null}
}
}