Configuring Slack for Integration with Unica

In version 12.1.2, Slack Integration is compatible only with Unica Plan. You must first configure the settings on Slack and then use those details and configure on Unica. To integrate Slack application with Unica Plan, complete the following list of procedures:

Slack configuration: Accessing workspace and sending invitations

Procedure

  1. After a successful sign in, you will see your workspace.
  2. If required, you can create multiple workspaces. The security token and member ID are specific to a workspace. To create a new workspace, select your workspace name and select Add workspaces > Create a new workspace.
    Note: In case of Unica, all users (including administrator) must reside on the same workspace because the OAuth tokens are limited only to a single workspace.
  3. To invite team members to a specific workspace:
    1. Access the required workspace.
    2. Select the workspace name and select Invite people to <workspace-name>.
  4. The Invite people to <workspace-name> dialog appears. Enter the emails IDs separated by semicolon and click Send.
  5. The Slackbot provides a notification when invitees accept the invitation and join Slack.
  6. You can view the members who have joined by accessing their profiles. Select the three horizontal dots and select Copy member ID to fetch their member ID.

Slack configuration: Creating an App

About this task

An administrator must create a Slack app with a set of permissions so that the app is ready for distribution to the team members.

The app, upon installation, uses the oauth token creation for the administrator of the app as well as the team members.

To create an app, complete the following steps:

Procedure

  1. Open a new tab in the browser on which your Slack session is running.
  2. Access the following URL:
  3. Click Create New App.
    The Create an App dialog appears.
  4. Select the option From scratch.
    The Name app & choose workspace dialog appears.
  5. Provide an appropriate value for App Name and select the required workspace for Pick a workspace to develop your app in.
  6. Click Create App.
    The App Summary page appears indicating successful creation of the app.
  7. Scroll down to the App Credentials section and copy the values of the following fields:
    • Client ID
    • Client Secret

Slack configuration: Additional configurations on Slack

About this task

You must complete the following additional configurations on Slack:

Procedure

  1. From the left pane, within the Settings section, select OAuth & Permissions.
  2. Scroll down to the Redirect URLs, Scopes, and IP Address Ranges section and click Edit via Manifest.
    The Manifest screen appears.
  3. Switch to the JSON tab.
  4. Append the following code, within the existing code, in the JSON tab:
    
    "oauth_config": {
            "redirect_urls": [
                "https://<<unica-domain.com>>/asset-viewer/api/AssetPicker/webhook/Slack/auth/user"
            ],
            "scopes": {
                "user": [
                    "channels:write",
                    "chat:write",
                    "groups:history",
                    "groups:read",
                    "groups:write",
                    "im:read",
                    "im:write",
                    "mpim:history",
                    "mpim:read",
                    "mpim:write"
                ]
            }
        }
    
    Note: In the earlier code, for the redirect_urls parameter, ensure that you replace <<unica-domain.com>> with an appropriate domain name, and that the protocol must be HTTPS.
    The complete entry in the JSON tab should be as follows:
    
    {
        "_metadata": {
        "major_version": 1,
        "minor_version": 1
    },
    "display_information": {
        "name": "slack_app_demo"
        },
        "oauth_config": {
        "redirect_urls": [
        "https://unica-domain.com/asset-viewer/api/AssetPicker/webhook/Slack/auth/user"
        ],
        "scopes": {
        "user": [
        "channels:write",
        "chat:write",
        "groups:history",
        "groups:read",
        "groups:write",
        "im:read",
        "im:write",
        "mpim:history",
        "mpim:read",
        "mpim:write" ]
        }
    },
    "settings": {
    "org_deploy_enabled": false,
    "socket_mode_enabled": false,
    "token_rotation_enabled": false
    }
    }
    
  5. Click Save Changes.

Slack configuration: Retrieving Administraor's OAuth Token

About this task

To retrieve administrator's OAuth token, the administrator must complete the following steps:

Procedure

  1. From the left pane, within the Settings section, select OAuth & Permissions.
    The OAuth & Permissions page appears.
  2. In the OAuth Tokens for Your Workspace section, click Install to Workspace.
  3. Note down the User OAuth Token.

Slack configuration: Distributing the Slack App

About this task

Before distributing Slack app to team members, admin must ensure that their own account and the Unica team members must be configured for the data source SLACK_DS using their respective Slack Member IDs. In case of the administrator, the password will be the OAuth token retrived in Slack configuration: Retrieving Administraor's OAuth Token. In case of other users, Password can be a dummy value as the system internally updates team member's OAuth token at the time of app installation by the team members. Unica admin must complete this step before distributing the Slack app. Before distributing the Slack app, ensure that you complete Unica configuration: Disabling Authentication for Inbound URL.

To distribute the Slack app, complete the following steps:

Procedure

  1. From the left pane, within the Distribution section, select Manage Distribution.
    The Manage Distribution page appears.
  2. Copy the Sharable URL and paste it in an editor.
  3. Share it with the required team members.
  4. When a team member tries to install Slack, the Slack bot will notify you about the installation request. You must approve the request by clicking Approve for Workspace in the notification window.
    Note: The first user getting the approval needs to continue the installation of Slack. All subsequent users will not have to go through the approval workflow.

Unica configuration: Registering App Credentials on Unica for the Administrator

About this task

Note: The administrator and the users must have the the Content Integration role asssigned to them. For more information on assigning roles to users or user groups, see Unica Platform Administrator Guide.
After receiving the Client ID and Client Secret from Slack configuration: Creating an App, you must register the credentials on Unica for Slack integration. To register the app credentials, complete the following steps:

Procedure

  1. Access the Unica application.
  2. Select Settings > Users.
  3. Select the username you want to register for app credentials. For example, asm_admin.
  4. Click Edit data sources.
  5. Click Add new.
  6. For the Data source field, provide the value SLACK_APP_DS.
  7. For the Data source login field, provide the value of Client ID that you copied from the app.
  8. For the Data source password and Confirm password fields, provide the value of Client Secret that you copied from the app.
  9. Click Save changes.

Unica configuration: Disabling Authentication for Inbound URL

About this task

You must disable authentication for the inbound URL /webhook/Slack/auth/* and create a security filter by completing the following steps:

Procedure

  1. Select Settings > Configuration.
  2. Expand Unica Platform > Security > API management > Unica Content Integration.
  3. Select Slack_inbound.
    If you do not see the Slack_inbound option, contact your Unica administrator.
  4. Click Edit settings.
  5. For the API URI field, provide the value /webhook/Slack/auth/*.
  6. Ensure that:
    • Block API access is Disabled.
    • Require authentication for API access is Disabled.
    • Secure API access over HTTPS is either Enabled or Disabled as per your environment requirements.
  7. Do not modify any other values and click Save changes.

Unica configuration: Registering the Administrator and Other Slack Invited Users on Unica

About this task

The admin can now use the member IDs, as retrieved in the section Slack configuration: Accessing workspace and sending invitations, and the User OAuth Token, as retrieved in the section Slack configuration: Retrieving Administraor's OAuth Token to register members on Unica by completing the following steps:

Procedure

  1. Select Settings > Users.
  2. Select the username you want to register for app credentials. For example, demo_user.
  3. Click Edit data sources.
  4. Click Add new.
  5. For the Data source field, provide the value SLACK_DS.
  6. For the Data source login field, provide the value of Member ID that you copied.
  7. For the Data source password and Confirm password fields:
    In case of the administrator, the password will be the OAuth token retrived in Slack configuration: Retrieving Administraor's OAuth Token. In case of other users, Password can be a dummy value as the system internally updates team member's OAuth token at the time of app installation by the team members.
  8. Click Save changes.

Unica configuration: Configuring Additional Parameters for Slack Data Source in Unica

About this task

To configure the additional parameters, complete the following steps:

Procedure

  1. Select Settings > Configuration.
  2. On the left pane, expand Plan > DataSources > cmsConfigurationTemplates.
    Note: Plan does not support partition.
  3. Click Slack
  4. Select HTTPS Gateway.
  5. Click Edit settings.
  6. For the Base URL field, provide the value https://slack.com/api.
  7. For the bypassProxy field, set the value No.
  8. Click Save changes.
  9. On the left pane, select Slack.
  10. Click Edit settings.
  11. For the Additional parameters field, add the following values:
    
    unicaAdminUserName: "asm_admin"
    dataSourceForSlackApp: "SLACK_APP_DS"
    alwaysCreatePublicChannel: true/false
    numberOfThreadsToRemoveChannelMembers: 4
    channelBaseUrl: "https://app.slack.com/messages/"
    
  12. Click Save changes.
  13. Expand HTTPS Gateway and select REST.
  14. Click Edit Settings.
  15. Ensure that the value of Authentication Type is set to None.
  16. Click Save changes.