Skip to main content

Authorization

Follow this guide to create a new Slack credential that will allow Nexla to authenticate to and exchange data with your Slack workspace.
slack_api_auth.png

Slack

Prerequisites

Before creating a Slack credential, you need to create a Slack app in your workspace and obtain your Client ID and Client Secret. Slack uses OAuth2 3-legged authentication for all API requests, requiring user authorization to obtain an access token.

To obtain your Slack credentials, follow these steps:

  1. Sign in to your Slack workspace using your administrator credentials.

  2. Navigate to the Slack API Apps page in your web browser.

  3. Click Create New App to create a new Slack app for API access.

  4. Select From scratch to create a new app from scratch, or choose From an app manifest if you have a manifest file.

  5. Configure your app settings:

    • Enter a name for your app (e.g., "Nexla Integration")
    • Select the workspace where you want to create the app
    • Click Create App to create the app
  6. After the app is created, navigate to OAuth & Permissions in the left sidebar under Features.

  7. Scroll down to the Scopes section and add the Bot Token Scopes required for your use case. Common scopes include:

    • Channels: channels:read, channels:history, channels:join for channel operations
    • Chat: chat:write, chat:write.public, chat:write.customize for sending messages
    • Users: users:read, users:read.email, users.profile:read for user information
    • Groups: groups:read, groups:history for private channel access
    • Direct Messages: im:read, im:history for direct message access
    • Reactions: reactions:read, reactions:write for reaction management
  8. Scroll up to the OAuth Tokens for Your Workspace section and click Install to Workspace to install the app to your workspace.

  9. Review the permissions requested by the app and click Allow to authorize the installation.

  10. After installation, you will be provided with your Bot User OAuth Token (starting with xoxb-). This token is used for API requests, but for OAuth2 3-legged authentication in Nexla, you need the Client ID and Client Secret.

  11. Scroll back up to the App Credentials section at the top of the OAuth & Permissions page. You will find your Client ID and Client Secret here. Copy both credentials immediately, as the Client Secret may not be accessible again after you navigate away from the page.

  12. Store both credentials securely, as you will need them to configure your Nexla credential. The Client ID and Client Secret are sensitive information and should be kept confidential.

The Client ID and Client Secret are used in the OAuth2 3-legged authorization flow. During credential creation in Nexla, you will be redirected to Slack to authorize the application. After authorization, Slack will provide an access token that is used in the Authorization: Bearer {token} header for all API requests to the Slack API. The token authenticates your requests and grants access to Slack resources based on the scopes you configured for your app. If your credentials are compromised, you should immediately revoke them in your Slack app settings and generate new ones. For detailed information about creating Slack apps, OAuth2 authentication, and available endpoints, refer to the Slack API Documentation.

Create a Slack Credential

  • To create a new Slack credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Slack

SlackCred.png

Credential Name & Description

  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

    Resource descriptions are recommended but are not required. They should be used provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.

OAuth2 3-Legged Authentication

Slack uses OAuth2 3-legged authentication for all API requests. The Client ID and Client Secret are used to initiate the OAuth2 authorization flow, which requires user authorization to obtain an access token.

  1. After entering your credential name and description, click Authorize or Connect to initiate the OAuth2 authorization flow. You will be redirected to Slack to authorize the application.

  2. Sign in to your Slack workspace if prompted, and review the permissions requested by the application.

  3. Click Allow to grant the application access to your Slack workspace.

  4. After authorization, you will be redirected back to Nexla, and the access token will be automatically configured for your credential.

    Your Slack OAuth credentials can be found in your Slack app settings under OAuth & Permissions > App Credentials. The Client ID and Client Secret are generated when you create a Slack app.

    These credentials are used to initiate the OAuth2 3-legged authorization flow. During credential creation, you will be redirected to Slack to authorize the application. After authorization, Slack will provide an access token that is used in the Authorization: Bearer {token} header for all API requests to the Slack API.

    If your credentials are compromised, you should immediately revoke them in your Slack app settings and generate new ones. The credentials provide access to your Slack workspace data and should be treated as sensitive information. Keep your credentials secure and do not share them publicly.

    For detailed information about creating Slack apps, OAuth2 authentication, API scopes, and available endpoints, see the Slack API Documentation and Slack API Quick Start Guide.

Save the Credential

  1. Once all of the relevant steps in the above sections have been completed, click the Save button at the bottom of the overlay to save the configured credential.

  2. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.