Slack Integration

The following document will capture the available integration points with Slack and how to configure them.

Oomnitza's Slack integration allows organizations to send messages to slack users, add a user to slack channels, manage the slack users within the SaaS module and many more. 

More info in Slack can be found here: https://slack.com/ 

File:Slack Technologies Logo.svg - Wikimedia Commons

Following integrations are available with Slack:

 

Authentication

Slack uses oAuth2 authentication. Please follow the documentation to create an OAuth2.0 app and keep your Client ID, Client Secret and Scope to be used when configuring your oAuth2 credential within Oomnitza. 

Documentation Links:

 

User Load

When creating an extended user load for Slack it is important to know that the Slack API (see details at https://api.slack.com/methods/users.list ) responds with all users, active as well as deleted ones, bots, external users and everyone else. Right now there is no possibility to filter them out within the API. We recommend to create a filter within Oomitza on the Connector side in the mapping to only load the active users. This will then only pass the active members on to the connector for further processing and loading these users into the user or SaaS User module. For this we added a few fields into the API as outlined below. To limit the list of users to get added into Oomnitza to only the Members, Admins and Owners, you might want to create a filter as follows: 
mceclip1.png

Another thing to consider especially when loading the users into the SaaS module is Slack fair billing policy, see https://slack.com/help/articles/218915077-Slacks-Fair-Billing-Policy which means you only get charged for active users.

 

Standard Mappings

The following fields can be mapped from Slack using Oomnitza's User Interface. For more information on creating Extended Connector Mappings, please see our article on Mapping Extended Connectors.

  • Deleted? - this allows you to only load the active users by specifying it as mentioned above using 0 for false and 1 for true.
  • Email - usually the email address is a good matching key for this integration and can be used to set as sync key for the user load as well as SaaS User load. In case a user does not have an email address in slack, which usually is the case for bot users, this will contain the user ID field instead to minimize connection errors due to missing data in the API.
  • First Name
  • Is Admin? - Boolean flag if the user has admin rights within Slack using 0 for false and 1 for true.
  • Is Bot user? - Boolean flag if the user is a bot. Use 0 for false and 1 for true.
  • Is restricted? - represents a user that has limited access to slack, like someone who is external to your organization and can only see a few channels.
  • Is ultra restricted? - this is a user that is limited to a single channel only.
  • Last Name
  • Phone
  • Skype
  • Team ID
  • Title
  • User ID - this is the user ID in slack which you would need to use to send messages to the user directly via the API preset. We recommend to map this to a user attribute called slack_user_id
  • User Name

Additional fields may be available through Slack. For details on how to retrieve them, please reach out to support@oomnitza.com or see our article on Mapping Extended Connectors.

 

SaaS User Role Block 

This block allows you to read a user's role (which is either Admin or User) from Slack and can be used within a SaaS User workflow. Please note that Slack does not provide a last login date and as such you can only get the Last Login date from SSO which for slack is not very reliable.

Within the SaaS User Role block we are able to identify different roles from within Slack. These are:

  • Deactivated - these are 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
  • 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 
  • Member - a regular user in Slack which you might get billed for based on the activity status

Note: All workflows must start with the "Begin" block. The configuration for SaaS User Role blocks can be found here: https://oomnitza.zendesk.com/hc/en-us/articles/360053185893

Note: With "Deactivated User" selected, we will automatically reconcile deactivated users from your SaaS system (Slack) back into Oomnitza.

Documentation Links:

 

API block (Presets)

The following Slack API block Presets are available:

  • Slack Invite User
  • Slack Invite User to Channel
  • Slack Send Message to User
  • Slack Deactivate User

 

Slack Invite User

This preset allows you to add a new user into your company's slack account. To use this preset, you need the proper OAuth2.0 Authentication method as described above and also maintain the slack team id for your organization in the global settings table via Slack.Team_id or replace it within the api preset in the advanced mode. This preset will require you to switch to advanced mode to enter the invitation text as well as a list of default channels for this new user within the body of the API call. You can find details on the referenced API at https://api.slack.com/methods/admin.users.invite . Accessing the Slack API will require an Enterprise license and the scope as defined in the slack documentation.

 

Slack Invite User to Channel

Using this API preset, you can invite a new user to a channel within your Slack SaaS. To use this preset, you need the proper OAuth2.0 Authentication method as described above, the channel Id you want to add the user to and the User's slack user ID. To find the proper ID for the channel click on the slack website URL in your browser or the channel detail view within your slack application. The channel ID begins with the letter C and contains both letters and numbers or you may also use the channel name by referring to it with a starting # sign, like #slack-channel-name. For the slack user ID, you can reference the field using the field notation like {{slack_user_id}} or {{assigned_to.slack_user_id}}.

 

Slack Send Message to User

Using this API block you can create a workflow that would send a message to a Slack user account or a channel within your Slack SaaS. To use this preset, you need the proper OAuth2.0 Authentication method as described above, and the User's slack user ID. 

For the slack user ID, you can reference the field using the field notation like {{slack_user_id}} (when within the user module) or {{assigned_to.slack_user_id}} (when building an assets workflow). For sending the message to a channel, see already channel notation above.

 

Slack Deactivate User

Using this preset you can create a workflow that would automatically deactivate a Slack user account within your Slack SaaS. Here the slack user is referenced in the URL using {{user_external_id}} which you would use within a SaaS User workflow, but you can replace this with a different variable within the advanced mode for the API block if needed.

 

Slack get SlackID by email

With this preset you can get a user's slack ID. This might be needed when you invite a new user to slack and want to send a message to that user immediately after the invite or add that user to a channel in slack right after adding the user. You should switch the API preset to advanced mode to do the proper field mapping of the slack ID to a field of your user object.

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk