Notification templates are user-customizable email templates used by the notification systems for request, step, and system events. Templates use the Liquid template framework to allow tokenized values.
Returns all notification_templates.
title
— String for notification_templates titleactive
— Boolean value to show active templatesinactive
— Boolean value for inactive templatesformat
— Ensure to include an accept header or add .xml or .json to the last path elementtoken
— Your API Token for authenticationERROR 403 Forbidden
— Occurs when the token is invalidERROR 404 Not Found
— Occurs when no records are foundTo test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
curl -i -H "accept: text/xml" -X GET http://[rails_host]/v1/notification_templates?token=[api_token]
curl -i -H "accept: application/json" -X GET http://[rails_host]/v1/notification_templates?token=[api_token]
An example of filters:
curl -i -H "accept: application/json" -H "Content-type: application/json" -X GET -d '{ "filters": { "title":"Exception Raised" } }' http://[rails_host]/v1/notification_templates?token=[api_token]
Returns a notification_template by id.
id
— Numerical unique id for recordformat
— Ensure to include an accept header or add .xml or .json to the last path elementtoken
— Your API Token for authenticationERROR 403 Forbidden
— Occurs when the token is invalid.ERROR 404 Not found
— Occurs when record to show is not found.To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
curl -i -H "accept: text/xml" -X GET http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
curl -i -H "accept: application/json" -X GET http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
Creates a new notification template from posted data.
title
— String title of the notification_templateevent
— String event for notification template with acceptable values:exception_raised
request_message
request_completed
request_cancelled
request_in_problem
request_on_hold
request_planned
request_resolved
request_started
step_started
step_ready
step_completed
step_blocked
step_problem
user_created
password_reset
password_changed
login
user_admin_created
format
— String format for notification_template (required, one of text/plain, text/enriched, text/html)body
— Text of the message in Liquid template format (required)description
— String description of the notification templateformat
— Ensure to include an accept header or add .xml or .json to the last path elementtoken
— Your API Token for authenticationERROR 403 Forbidden
— Occurs when the token is invalidERROR 422 Unprocessable entity
— Occurs when validation fails and objects and errors are returnedTo test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '<notification_template><title>JSON Template</title><format>text/html</format><event>exception_raised</event><body>An exception has occurred.</body></notification_template>' http://[rails_host]/v1/notification_templates?token=[api_token]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '{ "notification_template": { "title":"JSON Template", "format":"text/html", "event":"exception_raised", "body":"An exception has occurred." }}' http://[rails_host]/v1/notification_templates/?token=[api_token]
Updates an existing notification_template with values from a posted document.
title
— String title of the notification_template (required, unique)event
— String event for notification_template (required); acceptable values include:exception_raised
request_message
request_completed
request_cancelled
request_in_problem
request_on_hold
request_planned
request_resolved
request_started
step_started
step_ready
step_completed
step_blocked
step_problem
user_created
password_reset
password_changed
login
user_admin_created
format
— String format for notification_template (one of text/plain, text/enriched, text/html)body
— Text of the message in liquid template formatdescription
— String description of the notification templateformat
— Ensure to include an accept header or add .xml or .json to the last path elementtoken
— Your API Token for authenticationERROR 403 Forbidden
— Occurs when the token is invalidERROR 404 Not found
— Occurs when record to update is not foundERROR 422 Unprocessable entity
— Occurs when validation fails and objects and errors are returnedTo test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
curl -i -H "accept: text/xml" -H "Content-type: text/xml" -X PUT -d '<notification_template><name>Renamed Notification Template</name></notification_template>' http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "notification_template": { "name" : "Renamed Notification Template"}}' http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
Makes a notification template inactive. Sets the active
parameter for the notification template to false.
id
— Numerical unique id for recordformat
— Ensure to include an accept header or add .xml or .json to the last path elementtoken
— Your API Token for authenticationERROR 403 Forbidden
— Occurs when the token is invalid.ERROR 404 Not found
— Occurs when no records are found.To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:
curl -i -H "accept: text/xml" -X DELETE http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
curl -i -H "accept: application/json" -X DELETE http://[rails_host]/v1/notification_templates/[id]?token=[api_token]
The following JSON is a sample output from GET /v1/notification_templates
:
HTTP / 1.1 200 OK Server: Apache - Coyote / 1.1 X - UA - Compatible: IE = Edge ETag: "c9d636cf8d221dde77d0a1e14d401a1b" Cache - Control: max - age = 0, private, must - revalidate X - Request - Id: bf76331f81cc0a81dfbc43fd5af7162a X - Runtime: 0.435000 Content - Type: application / json; charset = utf - 8 Transfer - Encoding: chunked Date: Tue, 23 Oct 2012 20: 47: 50 GMT [{ "active": true, "body": "<p>The following exception was raised at {{params.SS_company_name}}:</p> <br/>\n{% if params.SS_exception_message %}\n<p><strong>Message:</strong></p>\n<p>{{params.SS_exception_message}}</p>\n{% endif %}\n{% if params.SS_exception_backtrace %}\n<p><strong>Backtrace:</strong></p>\n<p>{{params.SS_exception_backtrace}}</p>\n{% endif %}\n<p>LOGGING IN TO BMC RELEASE PROCESS MANAGEMENT<br />\n ==============================<br />\n {{ params.SS_login_url }}<br />\n</p>\n\n", "created_at": "2012-02-28T16:12:23-05:00", "description": "A system notification for application exceptions.", "event": "exception_raised", "format": "text/html", "id": 1, "subject": "Exception raised at {{params.SS_company_name}}", "title": "Exception Raised", "updated_at": "2012-02-28T16:12:23-05:00" }]
The following XML is a sample output from GET /v1/notification_templates/1
:
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-UA-Compatible: IE=Edge ETag: "3ca7c183df80a59700b56f1868511bab" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 30636053d3f3068a4844b219f715a6d5 X-Runtime: 0.146000 Content-Type: application/xml;charset=utf-8 Content-Length: 1133 Date: Tue, 23 Oct 2012 20:50:32 GMT <?xml version="1.0" encoding="UTF-8"?> <notification-template> <active type="boolean">true</active> <body><p>The following exception was raised at {{params.SS_company_name}}:</p> <br/> {% if params.SS_exception_message %} <p><strong>Message:</strong></p> <p>{{params.SS_exception_message}}</p> {% endif %} {% if params.SS_exception_backtrace %} <p><strong>Backtrace:</strong></p> <p>{{params.SS_exception_backtrace}}</p> {% endif %} <p>LOGGING IN TO BMC RELEASE PROCESS MANAGEMENT<br /> ==============================<br /> {{ params.SS_login_url }}<br /> </p> </body> <created-at type="datetime">2012-02-28T16:12:23-05:00</created-at> <description>A system notification for application exceptions.</description> <event>exception_raised</event> <format>text/html</format> <id type="integer">1</id> <subject>Exception raised at {{params.SS_company_name}}</subject> <title>Exception Raised</title> <updated-at type="datetime">2012-02-28T16:12:23-05:00</updated-at> </notification-template>