Let Oomnitza be your single source of truth!
You'll get visibility of your Slack users by creating configurable workflows to automate tasks such as:
-
- Messaging Slack users
- Adding users to Slack channels
- Managing Slack users within the SaaS module and much more.
Navigation
Setting the Slack Team Id as a global variable
Creating user workflows with the API block
Prerequisites
Before you create Slack workflows, you need to have added your Slack OAuth credentials to Oomnitza
We recommend that you also create the Slack last login and the Slack user integration. You can use the information retrieved in these integrations to trigger workflows that can invite new users to Slack, deactivate Slack users, and much more.
Setting the Slack Team Id as a global variable
To save time entering information when you create workflows, 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 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 Using 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 your Slack OAuth credentials to Oomnitza.
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 User and Bot scopes are 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 to 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 User scope is required for the Send message preset: admin.users:write
. For further information, see Slack API documentation: admin.users.invite.
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}}.
The following Bot scopes are required for the Send message preset:channels:manage
groups:write
im:write
mpim:write
. The following User scopes are required for the Send message preset:channels:write
groups:write
im:write
mpim:write
. For further information, see Slack API documentation: conversations.invite
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: chat.postMessage.
The following Bot and User scopes are required for the Send message preset: chat:write
. 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 notation like {{Slack_user_id}} if you prefer.
The following scope is required for the Deactivate User preset: admin
. For further information, see Slack API documentation: delete-users-id.
Reference articles for workflows
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 your Slack OAuth credentials to Oomnitza.
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 Bot and User scopes are required for the User preset: users:read
and users:read.email
.For further information, see Slack API documentation: users.list and Slack API documentation: users.lookupByEmail
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.
Comments
0 comments
Please sign in to leave a comment.