Generating API Token and Webhook URL for Integrating eG Enterprise with Slack

The primary pre-requisite for integrating eG Enterprise with Slack is to create a dedicated channel in Slack where the eG alerts should be sent. Once this is done, then you should proceed to do the following:

  • Generate an API token and an incoming Webhook URL in Slack for the eG manager to use;

  • Configure the eG manager with the channel name, API token, and Webhook URL

The procedure below describes how to generate the API token and Webhook URL in Slack.

  1. Go to the Slack API dashboard using the URL: https://api.slack.com/apps/. Figure 1 will then appear. Click on the Create an App button in Figure 1 to start creating a new app.

    Clicking on Create an App Button

    Figure 1 : Clicking on the Create an App button

  2. Figure 2 will then appear. Click on Blank app in Figure 2, and then click the Continue button.

    Clicking on Blank app option

    Figure 2 : Clicking on the Blank app option

  3. This will open Figure 3. To create an app from scratch, specify the App name and pick the Workspace in which the app should be created. A Slack workspace is made up of channels, where team members can communicate and work together. Make sure that the Workspace you select in Figure 3 is the same workspace in which you have created the channel for posting eG alerts.

    Creating a New App

    Figure 3 : Creating a new app

  4. Upon successful app creation, Figure 4 appears by default, displaying the OAuth settings of the new app. Now, proceed to configure a webhook for the new app by clicking the Incoming Webhooks option in the left panel of Figure 4.

    Clicking on Incoming Webhooks option

    Figure 4 : Clicking on the Incoming Webhooks option

  5. This will invoke Figure 5. Push the Activate Incoming Webhooks slider in Figure 5 to the right to activate incoming webhooks.

    Activating Incoming Webhooks

    Figure 5 : Activating Incoming Webhooks

  6. Then, scroll down Figure 5 and click the Add New Webhook button that becomes visible (see Figure 6).

    Adding a New Webook

    Figure 6 : Adding a new webhook

  7. Figure 7 will then appear. Using Figure 7, you can allow the new app access to Slack. For that, first select the Workspace of which you are a member. Then, from the Channel for webhook drop-down, select the Slack channel you have created specifically for posting eG alerts. Then, click the Allow button.

    Allowing the App Slack Access

    Figure 7 : Allowing the new app access to Slack

  8. The Incoming Webhooks page then reappears (seeFigure 8).

    The Incoming Webhooks Page

    Figure 8 : The Incoming Webhooks page reappears

  9. Now, scroll down Figure 8 to view the Webhook URL that has been auto-generated by Slack (see Figure 9). This is the URL that the eG manager will use to connect to Slack and post eG alerts as notifications to the Slack channel. Make a note of this URL by clicking the Copy button and pasting the copied URL to Clipboard or to any Editor.

    Copying Webhook URL to Clipboard

    Figure 9 : Copying the Webhook URL

  10. Now, click on the OAuth & Pernmissions option in the left panel, as indicated by Figure 9. Figure 10 will then appear.

    Viewing OAuth & Permissions

    Figure 10 : Clicking on OAuth & Permissions

  11. Scroll down Figure 10 to view the Bot User OAuth Token. Make a note of this token by clicking the Copy button. You will have to configure the eG manager with this token, so as to enable the eG manager to connect to the Slack channel.

    Copying the OAuth Token

    Figure 11 : Copying the Bot User OAuth Token

For the integration to work seamlessly, make sure you configure eG Enterprise with the dedicated Channel you created for the purpose of the integration (see Figure 7), the Webhook URL that was generated at step 9, and the Bot User OAuth Token that was generated at step 11 of the aforesaid procedure.