Slack has experienced a significant increase in its popularity and use since it first launched back in 2014. It has become the go-to collaboration tool for major enterprises of all sizes and industries. The ability to build your own slack apps and easily integrating with other systems makes it even more popular within the tech community. In this blog post, I explore the different features available within a slack app and how they can be leveraged with SAP Hybris Commerce using a quick and dirty prototype.
The yIntegration Slack App will be using the following features and functionality of the Slack API:
The integration app uses two slash commands to interact with Hybris Commerce, which is explained below:
/Stock: This command is used to get the stock of all the products and post it into the slack channel. If the product id is also provided as a parameter in the stock command, it will look up the stock for that particular product and get the stock status.
Stock for all products:
Stock for specified Product:
The yIntegration app also contains a bot which I used to trigger events using the Events API. I have subscribed the ‘hybrisbot’ to “app_mention” event which will be triggered every time the bot is mentioned in the slack chat. There are many other events that are available which can be used to subscribe to bot events.
Another use case which is implemented in the app is to notify slack about the cronjob results. I have extended the OOTB ‘electronics-CartRemovalJob’ to send notifications to slack about the cronjob results using the Slack Incoming Webhooks.