{
    "swagger":"2.0",
    "info":{
        "description":"Manage Notification",
        "version":"2023.04.18",
        "title":"REST API for Notification in OIG",
        "x-summary":"Manage Notification"
    },
    "basePath":"/iam/governance/selfservice/api/v1/notification",
    "securityDefinitions":{
        "basicAuth":{
            "type":"basic"
        }
    },
    "security":[
        {
            "basicAuth":[
            ]
        }
    ],
    "tags":[
        {
            "name":"Event details",
            "description":"This is used to fetch notification event details and its static data."
        },
        {
            "name":"Locale Template",
            "description":"This contains all the operations for Locales of specific Notification Templates."
        },
        {
            "name":"Notification Template",
            "description":"This contains all the operations for Notification Template."
        }
    ],
    "schemes":[
        "https",
        "http"
    ],
    "paths":{
        "/search/basic":{
            "get":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Find all notification templates",
                "description":"Retrieves all notification templates by providing the template name or event name as URL parameters. Sorting and pagination are supported.",
                "operationId":"searchNotificationTemplatesWithQueryParams",
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "name":"templateName",
                        "in":"query",
                        "description":"Template name that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"eventName",
                        "in":"query",
                        "description":"Event name that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"offset",
                        "in":"query",
                        "description":"Pagination start index from which results need to be returned.",
                        "required":false,
                        "type":"integer",
                        "format":"int32"
                    },
                    {
                        "name":"limit",
                        "in":"query",
                        "description":"Number of Notification Templates to be returned from startindex.",
                        "required":false,
                        "type":"integer",
                        "format":"int32"
                    },
                    {
                        "name":"orderBy",
                        "in":"query",
                        "description":"Attribute on which sorting needs to be done followed by colon and sort order.",
                        "required":false,
                        "type":"string"
                    }
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "type":"array",
                            "items":{
                                "$ref":"#/definitions/SearchResult"
                            }
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"search-basic-get",
                "x-filename-id":"search-basic-get"
            }
        },
        "/search/adv":{
            "get":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Find all locale specific templates",
                "description":"Retrieves all locale specific templates by providing the template name or event name or subject or locale as URL parameters. Sorting and pagination are supported.",
                "operationId":"searchLocaleTemplatesWithQueryParams",
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "name":"templateName",
                        "in":"query",
                        "description":"Template name that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"eventName",
                        "in":"query",
                        "description":"Event name that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"subject",
                        "in":"query",
                        "description":"Subject that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"locale",
                        "in":"query",
                        "description":"Locale name that needs to be searched.",
                        "required":false,
                        "type":"string"
                    },
                    {
                        "name":"offset",
                        "in":"query",
                        "description":"Pagination start index from which results need to be returned.",
                        "required":false,
                        "type":"integer",
                        "format":"int32"
                    },
                    {
                        "name":"limit",
                        "in":"query",
                        "description":"Number of Notification Templates to be returned from startindex.",
                        "required":false,
                        "type":"integer",
                        "format":"int32"
                    },
                    {
                        "name":"orderBy",
                        "in":"query",
                        "description":"Attribute on which sorting needs to be done followed by colon and sort order.",
                        "required":false,
                        "type":"string"
                    }
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "type":"array",
                            "items":{
                                "$ref":"#/definitions/SearchResult"
                            }
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"search-adv-get",
                "x-filename-id":"search-adv-get"
            }
        },
        "/template":{
            "post":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Create new notification template",
                "description":"Creates a new notification template in OIG.",
                "operationId":"addTemplate",
                "consumes":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"body",
                        "name":"body",
                        "description":"Template details for new notification template to be created.",
                        "required":true,
                        "schema":{
                            "$ref":"#/definitions/CreateNotificationTemplateBody"
                        }
                    }
                ],
                "responses":{
                    "201":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/ReturnedTemplateId"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-post",
                "x-filename-id":"template-post"
            }
        },
        "/template/{id}":{
            "get":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Fetch notification template",
                "description":"Fetches a particular notification template with the specified id.",
                "operationId":"lookupTemplate",
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"id",
                        "type":"number",
                        "description":"Notification template id.",
                        "required":true
                    }
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/FetchNotificationTemplate"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-{id}-get",
                "x-filename-id":"template-id-get"
            },
            "put":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Modify notification template",
                "description":"Modifies an existing notification template.",
                "operationId":"modifyNotificationTemplate",
                "consumes":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"id",
                        "type":"number",
                        "description":"Notification template id.",
                        "required":true
                    },
                    {
                        "name":"status",
                        "in":"query",
                        "description":"Modifies the status of notification template with the specific id.",
                        "required":false,
                        "type":"string",
                        "enum":[
                            "Enabled",
                            "Disabled"
                        ]
                    },
                    {
                        "in":"body",
                        "name":"body",
                        "description":"Template details to modify an already existing notification template.",
                        "required":true,
                        "schema":{
                            "$ref":"#/definitions/ModifyNotificationTemplateBody"
                        }
                    }
                ],
                "responses":{
                    "204":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/ReturnedStatus"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-{id}-put",
                "x-filename-id":"template-id-put"
            },
            "delete":{
                "tags":[
                    "Notification Template"
                ],
                "summary":"Delete notification template",
                "description":"Deletes a particular notification template with the specified id.",
                "operationId":"deleteTemplate",
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"id",
                        "type":"number",
                        "description":"Notification template id.",
                        "required":true
                    }
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/ReturnedStatus"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-{id}-delete",
                "x-filename-id":"template-id-delete"
            }
        },
        "/template/{id}/locale":{
            "post":{
                "tags":[
                    "Locale Template"
                ],
                "summary":"Add new locale to a notification template",
                "description":"Adds a new locale to an already existing notification template by providing language and country details as URL parameters.",
                "operationId":"addLocaleToTemplate",
                "consumes":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"id",
                        "type":"number",
                        "description":"Notification template id for which locale needs to be added.",
                        "required":true
                    },
                    {
                        "name":"lang",
                        "in":"query",
                        "description":"Language for locale template.",
                        "required":true,
                        "type":"string"
                    },
                    {
                        "name":"country",
                        "in":"query",
                        "description":"Country name for locale template.",
                        "required":true,
                        "type":"string"
                    },
                    {
                        "in":"body",
                        "name":"body",
                        "description":"Locale details for new locale template to be created.",
                        "required":true,
                        "schema":{
                            "$ref":"#/definitions/LocaleTemplateBody"
                        }
                    }
                ],
                "responses":{
                    "201":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/ReturnedTemplateId"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-{id}-locale-post",
                "x-filename-id":"template-id-locale-post"
            },
            "delete":{
                "tags":[
                    "Locale Template"
                ],
                "summary":"Delete locale from notification template",
                "description":"Deletes a locale from notification template by providing language and country details as URL parameters.",
                "operationId":"removeLocaleFromTemplate",
                "consumes":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"id",
                        "type":"number",
                        "description":"Notification template id for which locale needs to be removed.",
                        "required":true
                    },
                    {
                        "name":"lang",
                        "in":"query",
                        "description":"Language of locale template.",
                        "required":true,
                        "type":"string"
                    },
                    {
                        "name":"country",
                        "in":"query",
                        "description":"Country name of locale template.",
                        "required":true,
                        "type":"string"
                    }
                ],
                "responses":{
                    "201":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/ReturnedStatus"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"template-{id}-locale-delete",
                "x-filename-id":"template-id-locale-delete"
            }
        },
        "/events":{
            "get":{
                "tags":[
                    "Event details"
                ],
                "summary":"Fetch notification event list",
                "description":"Fetches all the notification events existing in OIG.",
                "operationId":"getEventList",
                "produces":[
                    "application/json"
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/EventList"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"events-get",
                "x-filename-id":"events-get"
            }
        },
        "/event/{eventType}/data":{
            "get":{
                "tags":[
                    "Event details"
                ],
                "summary":"Fetch static data associated with an event",
                "description":"Fetches static data associated with an event.",
                "operationId":"getStaticData",
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "in":"path",
                        "name":"eventType",
                        "type":"string",
                        "description":"Event type for which static data needs to be fetched.",
                        "required":true
                    }
                ],
                "responses":{
                    "200":{
                        "description":"successful operation.",
                        "schema":{
                            "$ref":"#/definitions/StaticData"
                        }
                    },
                    "400":{
                        "description":"Invalid input."
                    }
                },
                "x-internal-id":"event-{eventType}-data-get",
                "x-filename-id":"event-eventtype-data-get"
            }
        }
    },
    "definitions":{
        "SearchResult":{
            "type":"object",
            "properties":{
                "templateName":{
                    "type":"string",
                    "description":"Name of notification template."
                },
                "id":{
                    "type":"number",
                    "description":"Id of notification template."
                },
                "eventName":{
                    "type":"string",
                    "description":"Event name for notification template."
                },
                "subject":{
                    "type":"string",
                    "description":"Subject of notification template."
                },
                "locale":{
                    "type":"string",
                    "description":"Locale of notification template."
                },
                "status":{
                    "type":"string",
                    "description":"Status of notification template."
                },
                "createuser":{
                    "type":"string",
                    "description":"Create user for notification template."
                },
                "customId":{
                    "type":"string",
                    "description":"Custom id for notification template."
                }
            }
        },
        "ModifyNotificationTemplateBody":{
            "type":"object",
            "properties":{
                "localTemplateCollection":{
                    "type":"array",
                    "items":{
                        "type":"object",
                        "properties":{
                            "locale":{
                                "$ref":"#/definitions/LocaleTemplateBody"
                            }
                        }
                    }
                },
                "eventname":{
                    "type":"string",
                    "description":"Event Name of notification template."
                },
                "description":{
                    "type":"string",
                    "description":"Description of notification template."
                }
            }
        },
        "FetchNotificationTemplate":{
            "type":"object",
            "properties":{
                "localTemplateCollection":{
                    "type":"array",
                    "items":{
                        "type":"object",
                        "properties":{
                            "locale":{
                                "type":"object",
                                "properties":{
                                    "subject":{
                                        "type":"string",
                                        "description":"Subject of locale template."
                                    },
                                    "longmessage":{
                                        "type":"string",
                                        "description":"Long message of locale template."
                                    },
                                    "shortmessage":{
                                        "type":"string",
                                        "description":"Short message of locale template."
                                    },
                                    "contenttype":{
                                        "type":"string",
                                        "description":"Content type of locale template."
                                    },
                                    "encoding":{
                                        "type":"string",
                                        "description":"Encoding of locale template."
                                    }
                                }
                            }
                        }
                    }
                },
                "eventname":{
                    "type":"string",
                    "description":"Event Name of notification template."
                },
                "templatename":{
                    "type":"string",
                    "description":"Template name of notification template."
                },
                "description":{
                    "type":"string",
                    "description":"Description of notification template."
                }
            }
        },
        "CreateNotificationTemplateBody":{
            "type":"object",
            "properties":{
                "templatename":{
                    "type":"string",
                    "description":"Template name of notification template."
                },
                "eventname":{
                    "type":"string",
                    "description":"Event Name of notification template."
                },
                "description":{
                    "type":"string",
                    "description":"Description of notification template."
                }
            }
        },
        "ReturnedTemplateId":{
            "type":"object",
            "properties":{
                "templateid":{
                    "type":"number",
                    "description":"Template id of notification template."
                }
            }
        },
        "LocaleTemplateBody":{
            "type":"object",
            "properties":{
                "subject":{
                    "type":"string",
                    "description":"Subject of locale template."
                },
                "longmessage":{
                    "type":"string",
                    "description":"Long message of locale template."
                },
                "shortmessage":{
                    "type":"string",
                    "description":"Short message of locale template."
                },
                "contenttype":{
                    "type":"string",
                    "description":"Content type of locale template."
                },
                "encoding":{
                    "type":"string",
                    "description":"Encoding of locale template."
                }
            }
        },
        "EventList":{
            "type":"object",
            "properties":{
                "events":{
                    "type":"array",
                    "items":{
                        "type":"string"
                    }
                }
            }
        },
        "SubTree":{
            "type":"array",
            "items":{
                "type":"object",
                "properties":{
                    "name":{
                        "type":"string"
                    },
                    "type":{
                        "type":"string"
                    },
                    "entityName":{
                        "type":"string"
                    },
                    "searchable":{
                        "type":"string"
                    },
                    "required":{
                        "type":"string"
                    },
                    "subtree":{
                        "$ref":"#/definitions/SubTree"
                    }
                }
            }
        },
        "StaticData":{
            "type":"array",
            "items":{
                "type":"object",
                "properties":{
                    "name":{
                        "type":"string"
                    },
                    "type":{
                        "type":"string"
                    },
                    "entityName":{
                        "type":"string"
                    },
                    "searchable":{
                        "type":"string"
                    },
                    "required":{
                        "type":"string"
                    },
                    "subtree":{
                        "$ref":"#/definitions/SubTree"
                    }
                }
            }
        },
        "ReturnedStatus":{
            "type":"object",
            "properties":{
                "status":{
                    "type":"number",
                    "description":"Status of notification template."
                }
            }
        }
    }
}