Let Oomnitza be your single source of truth!
You'll get visibility of your Slack users as data from Slack is automatically transformed into consumable information and actionable insights.
Connect Oomnitza and Slack in minutes
Get the information and insights that you need to reduce costs and the time that you spend on administration tasks such as:
- Configurable dashboards and list views of key user information
- Configurable reports to share information about users with your colleagues and management
- Configurable workflows that you can easily create to automate tasks such as:
- Messaging Slack users
- Adding users to Slack channels
- Managing Slack users within the SaaS module and much more.
- Getting the last login information of Slack users and deactivating inactive user accounts.
Navigation
Setting the Slack Team Id as a global variable
Creating custom mappings for the user integration
Creating the last login user integration
Creating custom mappings for the last login user integration
Creating user workflows with the API block
Prerequisites
You should use OAuth 2.0 authentication for using all the presents and integrations in this document, with the exception of the last login user integration. This requires API authentication only, and the setup steps are documented in Creating the last login user integration.
Please follow the steps below to create an OAuth 2.0 app and keep your Client ID, Client Secret and Scope to be used when adding your OAuth 2.0 credential within Oomnitza.
- Go to https://api.Slack.com/apps.
- Click Create an App.
- Select From scratch.
- Enter a name and select your workspace.
- Click Create App. You will be brought to the Basic Information page.
- Select the Permissions box on the Basic Information page. Alternatively, select OAuth & Permissions in the navigation sidebar.
- In the Redirect URLs section, click Add New Redirect URL.
- Enter
https://generic-oauth2-proxy.oomnitza.com/oauth2/redirect_url
as the redirect URL. - Save the URL and scroll down to the Scopes section.
- Add the following Bot Token Scopes:
usergroups:read
users:read
users:read.email
groups:write
mpim:write
im:write
.
- Scroll to the top of the OAuth & Permissions page and click Install to Workspace. You'll be asked to provide your app permissions within your Slack workspace.
- Go back to the Basic Information page and copy your Client ID and Client Secret. You'll need this information when you add authentication credentials to the Oomnitza vault.
For further information, refer to Slack API Documentation: Basic app setup.
Adding your OAuth credentials
To add your Slack OAuth credentials in Oomnitza, complete the following steps:
- In Oomnitza, click Configuration> Security > Credentials, and then click Add new credential (+).
- On the INFORMATION tab, complete these actions:
- Add the name of the credential.
- Add the name of the owner.
- On the AUTHORIZATION tab, select OAuth 2.0 as the authorization type.
- From the SaaS list, select Slack.
- Enter your Client ID and Client Secret that you copied in step 12 of Setting up your Slack app.
- Add the following scopes (separated by a comma) to Oomnitza:
usergroups:read
users:read
users:read.email
groups:write
mpim:write
- Click Authenticate. You are prompted to log into Slack to authorize your request.
- Click CREATE.
You use the credentials that you added to create and customize your Slack integrations with Oomnitza.
Setting the Slack Team Id as a global variable
To save time entering information when you create the Invite new user workflow, you can add the Slack Team Id as a global variable in Oomnitza.
- In Oomnitza, click Configuration> General > Global Settings.
- Click Add new variable (+).
- Enter Slack.Team_id as the variable name.
- Enter the value for the Team Id.
- Save your changes.
Creating the user integration
As discussed in Prerequisites, this integration requires you to use your OAuth credentials that you created in Adding the credentials.
- From the menu, click Configuration > Integrations.
- Click Integrations List View
.
- On the Integrations page, scroll down to the Extended section for User Integrations.
- Click NEW INTEGRATION.
- In the New User Integration sidebar, click Slack.
- Click APPLY next to the Slack User Load, and then click NEXT twice.
Connect page
Best practice
To ensure that only live user records are streamed to Oomnitza, choose Update only as your integration preference. When you run the integration, you can check the error logs to see which user records weren't uploaded and why they weren't uploaded. You can then decide whether to upload the user records that were skipped by changing your integration preference to create and upload. See Access error logs.
On the connect page, complete the following steps to connect the integration:
- Enter a descriptive name for the integration such as Slack User Load. This name will be displayed on the Integrations page once the setup is complete.
- From the User Selection list, select User plus SaaS User or User only.
- If you select User plus SaaS User and you have multiple instances of the same SaaS application, select the application from the SaaS Selection list. If you have a single instance of the SaaS application, skip this step.
- From the installation type list, select Cloud.
- From the Credentials list, select your OAuth credentials that you created in Adding the credentials.
- From the Integration Preferences list, select Update only.
- Enter the name of the user of the integration.
- Click Next.
Creating custom mappings for the user integration
Map the Slack fields to Oomnitza fields and create custom mappings to get the user information that you need.
Complete these actions:
- Click Smart Mapping.
- You must create a custom mapping for the Slack User Id field. To do this, complete these steps:
- Click the down arrow on the Id field.
- Select Add new Oomnitza users field.
- Change the name of the new field to Slack User Id.
- Click CREATE.
- Create custom mappings to map any other field that you want to add to Oomnitza:
- Click the down arrow on the field that you want to map.
- Select Add new Oomnitza users field.
- Change the name of the field.
- Click CREATE.
- Assign a sync key to the Email field.
- Click NEXT.
Note: For all user loads, it is recommended that you map role information to an employee role in Oomnitza. Users need to have an employee role defined in order to access Oomnitza. If the role information is not available from the user load, it is recommended that you select Employee from the Oomnitza Role dropdown list. You have the option to overwrite this at a later point should the role information become available.
Slack to Oomnitza mappings
The following Slack fields can be mapped to Oomnitza:
Connector Sync Time
Deleted?
Email
First Name
Is Admin?
Is bot user?
Is restricted (guest) user?
Is ultra restricted (single channel only) user?
Last Name
Phone
Skype
Team ID
Title
User ID
User Name
Want to map more fields to Oomnitza?
Contact Support, or see Mapping extended connectors.
When you've completed mapping the Slack to Oomnitza fields, click NEXT.
Schedule
By default, user data is streamed to Oomnitza once every day.
You can configure the schedule to meet your needs such as changing the interval or changing the time so that the data is streamed when your system isn't busy.
- Configure your schedule.
- Click FINISH.
Result
A new tile is created for the integration on the Integrations page.
What to do next
If you want to see the information that is collected now, click the tile on the Integrations page and click RUN NOW.
If you want to change the integration settings, you can click a navigation link on the page, such as 4 Mappings, and edit the settings.
Creating the last login user integration
The last login user integration for Slack is unique in that it uses API authentication only. The User Load preset and other integrations listed in this document require OAuth.
To setup API authentication in Slack, complete the following steps:
- Go to https://api.Slack.com/apps.
- Click Create an App.
- Select From scratch.
- Enter a name and select your workspace.
- Click Create App. You will be brought to the Basic Information page.
- Scroll down to the App-Level Tokens section and click Generate Token and Scopes
- Add the following Scopes:
connections:write
authorizations:read
.
- Click Generate.
- Copy your token.
Return to Oomnitza with your token and complete the following steps:
- In Oomnitza, click Configuration >Security > Credentials.
- Click Add new credential (+).
- Add the information details. Enter a descriptive name for the credentials such as Slack Last Login (API Key), to distinguish it from the OAuth credentials.
- Click the AUTHORIZATION tab.
- Ensure that API Key is selected as the authorization type.
- Enter Authorization as the name of the token.
- Enter the API key.
- Ensure that Add to Header is selected.
- Save your changes
Now that you have your credentials setup in Oomnitza, you can begin running the integration.
- From the menu, click Configuration > Integrations.
- Click Integrations List View
.
- On the Integrations page, scroll down to the Extended section for User Integrations.
- Click NEW INTEGRATION.
- In the New User Integration sidebar, click Slack.
- Click APPLY next to the Slack User Load - Last Login, and then click NEXT twice.
Connect page
Best practice
To ensure that only live user records are streamed to Oomnitza, choose Update only as your integration preference. When you run the integration, you can check the error logs to see which user records weren't uploaded and why they weren't uploaded. You can then decide whether to upload the user records that were skipped by changing your integration preference to create and upload. See Access error logs.
On the connect page, complete the following steps to connect the integration:
- Enter a descriptive name for the integration such as Slack Last Login User Load. This name will be displayed on the Integrations page once the setup is complete.
- From the User Selection list, select User only
- From the Installation type list, select Cloud.
- From the Credentials list, select your API key credentials.
- From the Integration Preferences list, select Update only
Note: Based on this selection, you will see lots of skipped records and no added records in the integration log, which is expected. - Enter the name of the user of the integration.
- Enter the Maximum number of pages to load from the API. The number should be between 1 and 999. We recommend that this value should be set to no greater than 3 times your employee count.
- Click Next.
Creating custom mappings for the last login user integration
Map the Slack fields to Oomnitza fields and create custom mappings to get the user information that you need.
Complete these actions:
- Click Smart Mapping.
- You must create a custom mapping for the Slack User Id field. To do this, complete these steps:
- Click the down arrow on the User Id field.
- Select Add new Oomnitza users field.
- Change the name of the new field to Slack User Id.
- Click CREATE.
- You must create a custom mapping for the Slack Date Last field. To do this, complete these steps:
- Click the down arrow on the Date Last field.
- Select Add new Oomnitza users field.
- Change the name of the new field to Slack Last Login. In the Data Type dropdown, select DateTime.
- Click CREATE.
- Create custom mappings to map any other field that you want to add to Oomnitza:
- Click the down arrow on the field that you want to map.
- Select Add new Oomnitza users field.
- Change the name of the field.
- Click CREATE.
- Assign a sync key to the Username field.
- Click NEXT.
Note: For all user loads, it is recommended that you map role information to an employee role in Oomnitza. Users need to have an employee role defined in order to access Oomnitza. If the role information is not available from the user load, it is recommended that you select Employee from the Oomnitza Role dropdown list. You have the option to overwrite this at a later point should the role information become available.
Slack to Oomnitza mappings
The following Slack fields can be mapped to Oomnitza:
Connect: Credentials
Connect: Maximum number of pages
Connector Sync Time
Count
Country
First Used Timestamp
Last Used Timestamp
Ip
Isp
Region
User Agent
User Id
Username
Want to map more fields to Oomnitza?
Contact Support, or see Mapping extended connectors.
When you've completed mapping the Slack to Oomnitza fields, click NEXT.
Schedule
By default, user data is streamed to Oomnitza once every day.
You can configure the schedule to meet your needs such as changing the interval or changing the time so that the data is streamed when your system isn't busy.
- Configure your schedule.
- Click FINISH.
Result
A new tile is created for the integration on the Integrations page.
What to do next
If you want to see the information that is collected now, click the tile on the Integrations page and click RUN NOW.
If you want to change the integration settings, you can click a navigation link on the page, such as 4 Mappings, and edit the settings.
Tip: Once you have the last login data mapped to the Slack Last Login, you can run a scheduled workflow using the Slack SaaS user role API to pull the data into the SaaS user record when it can be used for further processing and license compliance workflows.
Creating workflows
Creating user workflows with the API block
To reduce your workload and automate complex and repetitive tasks, you can create user workflows with the API block by following the steps in Creating user workflows with the API block. To locate the available presets, enter Slack in the Select Preset search field. Select your preset of choice and for every preset enter the following information in the Configure section:
- Your Slack Credentials that you created in Adding the credentials.
The Slack API block workflow comes with the following presets for users:
Get SlackID by email
Invite new user
Invite users to channel
Send message
Deactivate user
Using the Get SlackID by email preset
The Get SlackID by email preset enables you to retrieve a single user by looking them up by their registered email address. This might be needed when you onboard a new user to Slack. When you select this preset, you need to map the API response to an Oomnitza field. To do this, complete the following steps:
- In the API block window, click the Advanced Mode button located in the upper right of the window.
- Select the Response tab. Map the Response field {{ response.user.id }} to an Oomnitza field. For example, you could map {{ response.user.id }} to the Slack User Id field you created in Creating custom mappings.
The following scope is required for the Send message preset: users:read.email
. For further information, see Slack API documentation: Lookup email.
Using the Invite new user preset
The Invite new user preset allows you to add a new user into your company's Slack account. When you select this preset the following information is required:
-
The Slack Channel Ids you wish to invite the new user to. To find your Channel Id, right click on your channel name and select Copy Link. The Slack URL will be in the following format:
https://myteam.slack.com/archives/[channelid].
Your Channel ID begins with the letter C and contains both letters and numbers. You may also enter the channel name by referring to it with a # sign, for example: #Slack-channel-name. - The Invitation Message to the new user.
- Your Team Id should be derived from the Slack.Team_id variable you set in Setting the Slack Team Id as a global variable, or can be added manually.
Use the Advanced Mode to configure the message payload. To do this,
- In the API block window, click the Advanced Mode button located in the upper right of the window.
- Select the Body tab. Modify, update or add fields that will be used in the request payload. For information on the fields that are permitted in the request payload, see Slack API documentation: Invite user.
The following scope is required for the Send message preset: admin.users:write
. For further information, see Slack API documentation: Invite user.
Using the Invite user to channel preset
The Invite user to channel preset enables you to invite a new user to a channel within your Slack SaaS. When you select this preset the following information is required:
- The Slack Channel Ids you wish to invite the new user to. For further information on Channel Ids, refer to Using the Invite user to channel preset.
- The Slack User Ids of the user(s). You can reference the field using the field notation like {{Slack_user_id}} or {{assigned_to.Slack_user_id}} if you are building an assets workflow.
The following scope is required for the Send message preset: admin.users:write
. For further information, see Slack API documentation: Invite user.
Using the Send message preset
The Send message preset enables you to send a message to a Slack user or a channel within your Slack SaaS. When you select this preset the following information is required:
- The Slack Channel Ids you wish to invite the new user to. For further information on Channel Ids, refer to Using the Invite user to channel preset.
- Your Message to the user.
Use the Advanced Mode to configure the message payload. To do this,
- In the API block window, click the Advanced Mode button located in the upper right of the window.
- Select the Body tab. Modify, update or add fields that will be used in the request payload. For information on the fields that are permitted in the request payload, see Slack API documentation: Send message.
The following scope is required for the Send message preset: chat:write,chat:write:user,chat:write:bot
. For further information, see Slack API documentation: Send message.
Using the Deactivate user preset
The Deactivate user preset enables you to deactivate a Slack user account within your Slack SaaS. A user id is required for this preset and can be configured in Advanced Mode. To do this,
- In the API block window, click the Advanced Mode button located in the upper right of the window.
- In the Information tab, you will notice that the Slack user id is referenced in the variable {{user_external_id}}. You can replace this with the actual user id or a different variable if you prefer.
The following scope is required for the Deactivate User preset: admin.users:write
. For further information, see Slack API documentation: Remove user.
Creating Saas user workflows
You can create the SaaS User workflow by following the steps in Creating SaaS user workflows. To locate the available presets, enter Slack in the Select Preset search field. Select your preset of choice and for every preset enter the following information in the Configure section:
- Your Slack Credentials that you created in Adding the credentials.
The Slack SaaS User workflow block comes with one available preset, the SaaS user role API.
Slack SaaS user role API
Within the Slack SaaS User Role block we are able to identify different Slack roles. These are:
- Deactivated - Deleted users.
- Bot - Users that are used for the various bot activities.
- Single-Channel Guest - External users to your organization that only have access to one or a few channels.
- Multi-Channel Guest - External users to your organization that have access to multiple channels.
- Primary Owner - The primary account owner. This user is always also an Admin user.
- Owner - Additional owners. These users are always also an Admin user.
- Admin - Account administrators.
- Member - A regular user in Slack which you might get billed for based on the activity status.
The following scope is required for the User preset: users:read, users:write, users:read.email
. For further information, see Slack API documentation: User list.
Tip: The Slack User API returns a list of all Slack users listed above. To refine the type of users returned, we recommend creating a filter in the integration mapping page to only load active users. This will then only pass active members to the connector for further processing and load these users into the user or SaaS User module. For information on connector mapping see, Filtering results. To limit the list of users to get added into Oomnitza to members, admins, owners, multi-channel guests and single channel guests, you might want to create a filter as follows:
To filter single-channel guests, add the ultra-restricted
attribute to this list as well.
Another thing to consider when loading the users in the SaaS module is Slack fair billing policy, which means you only get charged for active users. For further information see, Slack's fair billing policy.
For further information on workflows see: Understanding workflows
Workflow block overview
Useful Slack API documentation
- Slack Authentication: Overview
- Slack Authentication: Installing with OAuth2.0
- Slack API: OAuth2.0 Access
Unleash the power of Oomnitza
To get valuable actionable insights that help you manage your assets, learn how to:
- Configure dashboards for your users and software
- Configure custom reports about your users and software
- Create workflows to automate tasks
See Getting started
Comments
0 comments
Please sign in to leave a comment.