IBM Cloud API Docs

Introduction

This API is for managing your custom notification templates. You can create a custom template for a notification to override the built-in template.

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response always indicates success. A 400 type response is some sort of failure, and a 500 type response usually indicates an internal system error.

Methods

listTemplates

List all custom notification templates

GET /notificationTemplates/v1

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Response

Status Code

  • Summary of custom notification templates

  • User credentials are not authenticated for this request

  • User does not have privileges for this request

  • There was an internal error processing the request

Example responses
  • [
      {
        "name": "template",
        "description": "This is a sample custom notification template.",
        "enabled": true,
        "templateURI": "https://testhost.com/api/notificationTemplates/v1/template",
        "lastUpdated": "2017-11-02T18:03:44.614Z",
        "lastUpdatedBy": "johndoe@yourco.us.com"
      }
    ]

createTemplate

Creates a custom notification template

POST /notificationTemplates/v1

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Custom notification template payload

Response

Status Code

  • A single custom notification template

  • Invalid request

  • User credentials are not authenticated for this request

  • User does not have privileges for this request

  • There was an internal error processing the request

Example responses
  • {
      "name": "template",
      "description": "This is a sample custom notification template.",
      "enabled": true,
      "overrides": {
        "email": {
          "subject": "Sample subject",
          "body": "Sample email body with substitution {{Where}}"
        }
      },
      "lastUpdated": "2017-11-02T18:03:44.614Z",
      "lastUpdatedBy": "johndoe@yourco.us.com"
    }

replaceTemplate

Replace the custom notification template with the template payload provided.

PUT /notificationTemplates/v1/{name}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Custom notification template name

Custom notification template payload

Response

Status Code

  • A single custom notification template after update

  • Invalid request

  • User credentials are not authenticated for this request

  • User does not have privileges for this request

  • The requested object was not found

  • There was an internal error processing the request

No Sample Response

This method does not specify any sample responses.

getTemplate

Get a custom notification template by name.

GET /notificationTemplates/v1/{name}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Custom notification template name

Response

Status Code

  • A single custom notification template

  • User credentials are not authenticated for this request

  • User does not have privileges for this request

  • The requested object was not found

  • There was an internal error processing the request

Example responses
  • {
      "name": "template",
      "description": "This is a sample custom notification template.",
      "enabled": true,
      "overrides": {
        "email": {
          "subject": "Sample subject",
          "body": "Sample email body with substitution {{Where}}"
        }
      },
      "lastUpdated": "2017-11-02T18:03:44.614Z",
      "lastUpdatedBy": "johndoe@yourco.us.com"
    }

deleteTemplate

Delete a custom notification template

DELETE /notificationTemplates/v1/{name}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Custom notification template name

Response

Status Code

  • Successful request

  • User credentials are not authenticated for this request

  • User does not have privileges for this request

  • The requested object was not found

  • There was an internal error processing the request

No Sample Response

This method does not specify any sample responses.