{"swaggerDoc":{"swagger":"2.0","info":{"description":"This is the documentation of the Notification System. Add text explaining each object.","version":"1.0.0","title":"Notification System","license":{"name":"Copyright © 2012-24 by Hildebrand Technology Limited"}},"host":"api.glowmarkt.com","basePath":"/api/v0-1/ns","tags":[{"name":"alerttype","description":"The definition of an alert, what functionality the alert represents. It is an identifier which amongst other elements will point us to the correct template. An alert type belongs to an application."},{"name":"template","description":"The template of the message that is being sent; it can be passed through as HTML or JSON. Each template has an alert type, is specific to a single channel of communication and a culrture code."},{"name":"alert","description":"An application can send an alert to a customer across multiple channels (email, push, inbox) which will convey some type of specific message (defined by the alert type)."},{"name":"notification","description":"When an application triggeers an alert, for each channel of communication a notification is created. This enables the system to monitor seperately whant happens in each channel."}],"schemes":["https"],"paths":{"/alerttype":{"get":{"tags":["alerttype"],"summary":"Find all alert types of an application","description":"Returns all alert types, created by an application","operationId":"getAlertTypes","produces":["application/json"],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/AlertType"}}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}},"post":{"tags":["alerttype"],"summary":"Create an alert type","description":"Create an alert type","operationId":"addAlertType","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"AlertTypeReq","description":"The information of an application.","schema":{"$ref":"#/definitions/AlertTypeReq"}}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AlertType"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/alerttype/{alertTypeId}":{"get":{"tags":["alerttype"],"summary":"Find alert type by ID","description":"Returns a single alert type","operationId":"getAlertTypebyId","produces":["application/json"],"parameters":[{"name":"alertTypeId","in":"path","description":"ID of alert type that is being queried","required":true,"type":"string"}],"security":[{"orgAppKeys":[]},{"devUserToken":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AlertType"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"404":{"description":"Not Found","schema":{"type":"string","example":null}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}},"put":{"tags":["alerttype"],"summary":"Updates the alert type's metadata.","operationId":"updateAlertType","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"alertTypeId","in":"path","description":"ID of the alert type that needs to be updated","required":true,"type":"string"},{"in":"body","name":"alertTypeUpdateBody","description":"The elements of an alert type that can be updated.","schema":{"type":"object","properties":{"name":{"type":"string","example":"UpdatedExampleNameOfAlert"}},"required":["name"]}}],"security":[{"orgAppKeys":[]},{"devUserToken":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AlertTypeUpdate"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/alert":{"post":{"tags":["alert"],"summary":"Send an alert","description":"Send an alert to a user","operationId":"sendAlert","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"AlertReq","description":"The information required to send an alert.","schema":{"$ref":"#/definitions/AlertReq"}}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AlertRes"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/alert/{alertId}":{"get":{"tags":["alert"],"summary":"Get an alert by Id","description":"Get an alert by Id","operationId":"findAlertById","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"alertId","in":"path","description":"ID of alert that is being queried","required":true,"type":"string"}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Alert"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/alert/user":{"get":{"tags":["alert"],"summary":"Get the alerts sent to a user","description":"Get the alerts sent to a user","operationId":"findAlertsOfUser","consumes":["application/json"],"produces":["application/json"],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Alert"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/template":{"get":{"tags":["template"],"summary":"Find all templates of an application","description":"Returns all templates that belong to an application.","operationId":"getTemplates","produces":["application/json"],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Template"}}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}},"post":{"tags":["template"],"summary":"Create a template","description":"Create a template","operationId":"addTemplate","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"TemplateReq","description":"The information of a template.","schema":{"$ref":"#/definitions/TemplateReq"}}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Template"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/template/{templateId}":{"get":{"tags":["template"],"summary":"Find template type by ID","description":"Returns a single template of an application","operationId":"getTemplatebyId","produces":["application/json"],"parameters":[{"name":"templateId","in":"path","description":"ID of the template that is being queried","required":true,"type":"string"}],"security":[{"orgAppKeys":[]},{"devUserToken":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Template"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"404":{"description":"Not Found","schema":{"type":"string","example":null}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}},"put":{"tags":["template"],"summary":"Updates the teplate's metadata.","operationId":"updateTemplate","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"templateId","in":"path","description":"ID of the alert type that needs to be updated","required":true,"type":"string"},{"in":"body","name":"alertTypeUpdateBody","description":"The elements of an alert type that can be updated.","schema":{"type":"object","properties":{"name":{"type":"string","example":"UpdatedExampleNameOfAlert"}},"required":["name"]}}],"security":[{"orgAppKeys":[]},{"devUserToken":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/AlertTypeUpdate"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/template/{alertTypeId}/{channelType}/{cultureCode}":{"get":{"tags":["template"],"summary":"Find template by alertTypeId, channeType and cultureCode","description":"Returns a single template of an application.","operationId":"getTemplatebyCharacteristics","produces":["application/json"],"parameters":[{"name":"alertTypeId","in":"path","description":"ID of alert type that is being queried","required":true,"type":"string"},{"name":"channelType","in":"path","description":"the channel type of the template (push, email, inbox)","required":true,"type":"string"},{"name":"cultureCode","in":"path","description":"language specific information en-GB, en_US","required":true,"type":"string"}],"security":[{"orgAppKeys":[]},{"devUserToken":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Template"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"404":{"description":"Not Found","schema":{"type":"string","example":null}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}},"post":{"tags":["template"],"summary":"Create template by alertTypeId, channeType and cultureCode","description":"Create template by alertTypeId, channeType and cultureCode","operationId":"addTemplatebyCode","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"alertTypeId","in":"path","description":"ID of alert type that is being queried","required":true,"type":"string"},{"name":"channelType","in":"path","description":"the channel type of the template (push, email, inbox)","required":true,"type":"string"},{"name":"cultureCode","in":"path","description":"language specific information en-GB, en_US","required":true,"type":"string"},{"in":"body","name":"TemplateReq","description":"The information of a template.","schema":{"$ref":"#/definitions/TemplateReq"}}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Template"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/notification/{notificationId}":{"get":{"tags":["notification"],"summary":"Get a notification by Id","description":"Get a notification by Id","operationId":"findNotificationById","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"notificationId","in":"path","description":"ID of notification that is being queried","required":true,"type":"string"}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Notification"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}},"/notification/{notificationId}/log":{"get":{"tags":["notification"],"summary":"Get the logs of a particular notification","description":"Get the logs of a particular notification","operationId":"getNotificationLogs","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"notificationId","in":"path","description":"ID of notification that is being queried","required":true,"type":"string"}],"security":[{"appKeys":[]},{"orgAppKeys":[],"applicationId":[]},{"devUserToken":[],"applicationId":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/NotificationLog"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/MissingElementsError"}},"401":{"description":"Unauthorised","schema":{"$ref":"#/definitions/AccessDeniedError"}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/InternalServerError"}}}}}},"securityDefinitions":{"orgAppKeys":{"type":"basic"},"appKeys":{"type":"basic"},"devUserToken":{"type":"apiKey","name":"token","in":"header"},"userToken":{"type":"apiKey","name":"token","in":"header"},"applicationId":{"type":"apiKey","name":"applicationId","in":"header"},"organizationId":{"type":"apiKey","name":"organizationId","in":"header"}},"definitions":{"AlertType":{"type":"object","properties":{"alertTypeId":{"type":"string","example":"b7ba20b1-0ef6-4bda-a8b3-6e7e8e091c4c"},"applicationId":{"type":"string","example":"0537b17c-ab62-491c-8085-9ac2b6206346"},"systemAlertTypeId":{"type":"string","example":"CM01"},"name":{"type":"string","example":"ExampleNameOfAlert"},"description":{"type":"string","example":"Description of Alert Type"},"active":{"type":"boolean"}},"required":["alertTypeId","applicationId","name"],"xml":{"name":"AlertType"}},"AlertReq":{"type":"object","properties":{"userId":{"type":"string","example":"69f464fa-bca2-4f2a-83b1-0c69819c5cd0"},"alertTypeId":{"type":"string","example":"CM01"},"send2Inbox":{"type":"string","example":"yes","enum":["yes","no"]},"send2Push":{"type":"string","example":"yes","enum":["yes","no"]},"email":{"type":"string","example":"yes","enum":["yes","no"]},"inbox":{"type":"string","example":"yes","enum":["yes","no"]},"push":{"type":"string","example":"yes","enum":["yes","no"]},"Priority":{"type":"string","example":"High","enum":["High","Low"]},"callbackUrl":{"type":"string","example":"https://api.glowmarkt.com/api/v0-1/test"},"dataToFill":{"type":"object"}},"xml":{"name":"AlertReq"}},"AlertRes":{"type":"object","properties":{"ns_alert_id":{"type":"string","example":"2cd8ddcc-3eb1-489d-b204-450e0887d0d8"},"status":{"type":"string","example":"OK"}},"xml":{"name":"AlertRes"}},"Alert":{"allOf":[{"$ref":"#/definitions/AlertReq"},{"properties":{"ns_alert_id":{"type":"string","example":"2cd8ddcc-3eb1-489d-b204-450e0887d0d8"}}}]},"AlertTypeReq":{"type":"object","properties":{"systemAlertTypeId":{"type":"string","example":"CM01"},"description":{"type":"string","example":"HighPowerUse"},"name":{"type":"string","example":"AlertExample"}}},"AlertTypeUpdate":{"type":"object","properties":{"alertTypeId":{"type":"string","example":"b7ba20b1-0ef6-4bda-a8b3-6e7e8e091c4c"},"applicationId":{"type":"string","example":"0537b17c-ab62-491c-8085-9ac2b6206346"},"systemAlertTypeId":{"type":"string","example":"CM01"},"name":{"type":"string","example":"UpdatedExampleNameOfAlert"},"description":{"type":"string","example":"Description of Alert Type"},"active":{"type":"boolean"}}},"NotificationLog":{"type":"object","properties":{"notificationid":{"type":"string","example":"084c7aef-a94f-4b8b-b053-afc35257f91b"},"Pipeline":{"type":"string","example":null},"ns_alert_id":{"type":"string","example":"2cd8ddcc-3eb1-489d-b204-450e0887d0d8"},"channel":{"type":"string","example":"push","enum":["push","email","inbox"]},"userid":{"type":"string","example":"69f464fa-bca2-4f2a-83b1-0c69819c5cd0"},"Stage":{"type":"string","example":"Added Notification Record"},"workflowStepNum":{"type":"number","example":1},"Status":{"type":"string","example":"OK"},"status_at":{"type":"string","example":"2021-09-15T13:43:15.890Z"}},"xml":{"name":"NotificationLog"}},"Notification":{"type":"object","properties":{"notificationid":{"type":"string","example":"084c7aef-a94f-4b8b-b053-afc35257f91b"},"ns_alert_id":{"type":"string","example":"2cd8ddcc-3eb1-489d-b204-450e0887d0d8"},"received_dtm":{"type":"string","example":"2021-09-15T13:43:15.890Z"},"Status":{"type":"string","example":"OK"},"status_at":{"type":"string","example":"2021-09-15T13:43:15.890Z"},"channel":{"type":"string","example":"push","enum":["push","email","inbox"]},"userid":{"type":"string","example":"69f464fa-bca2-4f2a-83b1-0c69819c5cd0"},"alertData":{"allOf":[{"$ref":"#/definitions/Alert"}]}},"xml":{"name":"Notification"}},"Template":{"type":"object","properties":{"templateId":{"type":"string","example":"65f214bb-cbcc-48dc-a55a-2a01c88f7079"},"alertTypeId":{"type":"string","example":"b7ba20b1-0ef6-4bda-a8b3-6e7e8e091c4c"},"applicationId":{"type":"string","example":"0537b17c-ab62-491c-8085-9ac2b6206346"},"systemAlertTypeId":{"type":"string","example":"CM01"},"name":{"type":"string","example":"ExampleNameOfAlert"},"description":{"type":"string","example":"Description of Alert Type"},"channelType":{"type":"string","enum":["push","email","inbox"],"example":"email"},"cultureCode":{"type":"string","enum":["en-GB","en-US"]},"htmlTemplate":{"type":"string","example":"Hello {{name}}, You recently register to the Glow platform. Please use the following 4-digit token to complete the registration process. {{token}} This token is only valid for the next hour."},"active":{"type":"boolean"}},"required":["alertTypeId","applicationId","name"],"xml":{"name":"AlertType"}},"TemplateReq":{"type":"object","properties":{"alertTypeId":{"type":"string","example":"b7ba20b1-0ef6-4bda-a8b3-6e7e8e091c4c"},"applicationId":{"type":"string","example":"0537b17c-ab62-491c-8085-9ac2b6206346"},"systemAlertTypeId":{"type":"string","example":"CM01a"},"name":{"type":"string","example":"ExampleNameOfAlert"},"description":{"type":"string","example":"Description of Alert Type"},"channelType":{"type":"string","enum":["push","email","inbox"],"example":"email"},"cultureCode":{"type":"string","enum":["en-GB","en-US"]},"active":{"type":"boolean"},"htmlTemplate":{"type":"string","example":"Hello {{name}}, You recently register to the Glow platform. Please use the following 4-digit token to complete the registration process. {{token}} This token is only valid for the next hour."}},"required":["alertTypeId","cultureCode","applicationId","name"],"xml":{"name":"Template"}},"Error":{"type":"object","properties":{"error":{"type":"string"}},"xml":{"name":"Error"}},"AccessDeniedError":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}},"InternalServerError":{"type":"object","properties":{"error":{"type":"string","example":"An error has occurred"}}},"IncorrectElementsError":{"type":"object","properties":{"error":{"type":"string","example":"incorrect elements"}}},"MissingElementsError":{"type":"object","properties":{"error":{"type":"string","example":"missing elements"}}},"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"}}}},"externalDocs":{"description":"Find out more about Glowmarkt","url":"https://glowmarkt.com/"}},"customOptions":{}}