Accelerator Notifications Process API - Implementation Template
home
This API implementation template is a shared component of MuleSoft Accelerators, which accelerate the implementation of essential integration use cases.
The solution includes pre-built APIs, connectors, and integration templates that help unlock business-critical data from external systems and guide you in adopting best practices synthesized from thousands of customer implementations. Use these assets as is or extend them to meet your company’s unique needs.
Overview
This integration template implements the Notification Prc API specification. The Notification process API is used to orchestrate the data flow between the consumer (any process or system API) and either the email system API, SMS system API, or Slack system API depending on the notification type. It supports the following functionality:
- Sending an email via SMTP
- Sending a SMS via Twilio
- Sending a message to a Slack channel
- Sending a message to Anypoint MQ
Getting started
The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Once your workstation has been set up and the application template imported into Anypoint Studio, proceed with the Prerequisites section.
Prerequisites
This implementation template has the following dependencies:
- Anypoint MQ Destinations
- Accelerator Email System API
- Accelerator Slack System API
- Accelerator SMS System API
API dependencies
The following table lists all endpoints used by this API (assuming all syncronization targets are enabled).
API name | Endpoint | Action |
---|---|---|
Accelerator Email System API | post:/api/messages | Send an email message |
Accelerator Slack System API | post:/api/messages | Send a Slack message |
Accelerator SMS System API | post:/api/messages | Send an SMS message |
Anypoint MQ Destinations
In addition to the Anypoint MQ client application credentials, the following destinations must be created and made accessible to this API:
- accel-notifications-queue
- accel-notifications-dl-queue
Deployment
Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building and deploying the APIs to CloudHub. These scripts depend on repositories, global settings, deployment profiles, and associated properties configured in the Maven settings.xml
file. In particular, make sure the common properties for your environment have been provided in the CloudHub-DEV
profile (e.g., Anypoint Platform client ID and secret).
For additional details, please refer to the Application Deployment section of the Getting Started Guide.
Preparation
Ensure the Maven profile CloudHub-DEV
has been properly configured in your settings.xml
file. In particular, make sure the common properties for your environment have been provided (e.g., Anypoint Platform client ID and secret).
Required property overrides
Many templates can also be run from Anypoint Studio without having to customize the Run/Debug profiles. However, some templates make use of hidden deployment properties to protect sensitive information (e.g., passwords and secret keys). These properties must be supplied to the runtime by updating the configuration profile and adding them as VM arguments. At a minimum, the following properties must be customized to reflect the target deployment environment.
Property Name | Description |
---|---|
api.autodiscoveryID | Required if using API Manager to secure this API |
anypoint-mq.host | Anypoint MQ server host url |
anypoint-mq.notifications-client.client-id | Anypoint MQ Notifications client Id |
anypoint-mq.notifications-client.client-secret | Anypoint MQ Notifications client Secret |
anypoint-mq.destination | Anypoint MQ Notifications Exchange Name |
anypoint-mq.destination-queue | Anypoint MQ Notifications Queue Name bound to the exchange |
anypoint-mq.dead-letter-queue | Anypoint MQ Notifications Dead Letter Queue Name |
notifications-prc-api.http-client.client-id | Client Id of the App to access other APIs |
notifications-prc-api.http-client.client-secret | Client Secret of the App to access other APIs |
notifications-prc-api.email.http-requestor.host | Hostname for the Email System API |
notifications-prc-api.slack.http-requestor.host | Hostname for the Slack System API |
notifications-prc-api.sms.http-requestor.host | Hostname for the SMS System API |
Testing
Use Advanced Rest Client or Postman to send a request over HTTPS. The template includes a Postman collection in the src/test/resources
folder. Update the collection variable(s) after successful import.
Additional resources
- The Data mappings tab describes how the request and response data structures are mapped between the API interfaces.
- Refer to the Accelerators documentation home for more information about the MuleSoft Accelerators.