Documentation Index

Fetch the complete documentation index at: https://docs.algosolutions.com/llms.txt

Use this file to discover all available pages before exploring further.

Example: OAuth Configuration for Slack

Prev Next

This guide explains how to:

  • Integrate an Algo device with Slack using OAuth

  • Verify the configuration by sending a message to a Slack channel

  • Use the OAuth profile to send a message to a Slack channel from an Algo 8450

Note

This document includes third-party configuration procedures that are subject to change. It is provided for reference purposes only, and Algo cannot guarantee that the screenshots or procedures will always be current or up to date.

Before you start

Ensure you have the following:

  • A Slack account

  • A Slack channel where messages will be posted

Procedure Overview

This procedure includes the following steps:

  1. Creating a Slack Application

  2. Creating OAuth Authorization Profile

  3. Finding Your Slack Channel ID

  4. Testing "HELLO" Message to Channel

  5. (Optional): Configuring an 8450 Button to Send Message to a SLACK Channel


Creating a Slack Application

Create a Slack application and obtain the required credentials for OAuth.

To create a Slack Application:

  1. Go to https://slack.com/signin#/signin and sign in to your Slack account.

  2. Go to: https://api.slack.com/apps.

  3. Select Create New App.

  4. Select From scratch.

  5. Enter the following, then select Create App.

    • App Name: Enter a name for your application. For example, Algo Device Notifier.

    • Workspace: Select a workspace to develop your application in.

  6. Under App Credentials, copy the following information:

    • Client ID

    • Client Secret

      Note

      Keep your Client Secret secure. Do not share it.

      You need this information to configure OAuth later.

  7. Go to Features → OAuth & Permissions.

  8. Under Bot Token Scopes, select Add An OAuth Scope and type to add the following permissions:

    • chat:write (required) – Send messages

    • chat:write.public (optional) – Send messages to channels without joining.

    • channels:read (optional) – View public channels.

    • groups:read (optional) – View private channels the bot is in

  9. Under OAuth & Permissions, select Add New Redirect URL.

  10. Enter your Algo device’s callback URL using this format: https://<ALGO_DEVICE_IP>/control/oauth-callback.lua and select Add.

    Note

    The redirect URI must match exactly in both Webex and your Algo device's configuration.

  11. Select Save URLs.

  12. Select Install to Workspace.

  13. Select Allow so the application can access Slack.

  14. After installation, Slack generates a Bot User OAuth Token:

  15. Select Opt In for Advanced token security via token rotation.

    Recommended for developers building on or for security-minded organizations – opting into token rotation allows app tokens to automatically expire after they’re issued within your app code.

  16. When asked, select Opt In again to confirm it.

  17. Once Token rotation is enabled, you can see the following info

Creating an OAuth Authorization Profile

Create an OAuth profile to store your Slack authentication settings.

To create a Slack OAuth profile:

  1. Log in to your device’s web interface using HTTPS.

    HTTPS is required by Slack OAuth process.

  2. Go to the Advanced SettingsOAuth.

  3. Set a Name for your OAuth profile. For example, Slack.

  4. Select SLACK as the Provider Type.

  5. Accept the following automatically populated values:

    • Scope Mode: SCOPES_LIST

    • Scope: Set tochat:write,channels:read,chat:write.public,groups:read

    • PKCE Method: S256

    • Response Type: code

    • Client Auth Mode: CLIENT_SECRET_POST

  6. Configure the following:

    • Client ID: Enter your Client ID.

    • Client Secret: Enter your Client Secret.

    • PKCE Redirect URI: Set to https://<ALGO_DEVICE_IP>/control/oauth-callback.lua

      Note

      You must use HTTPS in the URI.

      Replace <ALGO_DEVICE_IP> with your device IP.

  7. Leave the following fields blank. These values are automatically populated during authorization.

    • PKCE Authorization Code

    • PKCE Code Verifier

    • PKCE Refresh Token

      Note

      Refresh tokens can expire or become invalid for several reasons, such as revoked app access, password changes, unused tokens, or admin policy restrictions. Refer to the OAuth provider’s documentation for more information. If a refresh token expires or becomes invalid, your automation stops working until OAuth access is reauthorized.

    • PKCE Grant Type Override

  8. Set Extra Params (JSON) as below:

    {
      "revocation_endpoint": "https://slack.com/api/auth.revoke"
    } 

  9. Select START AUTHORIZATION

  10. In the prompt, select Allow.

  11. Select Create Profile.

    Your profile appears under the OAuth Profiles list.

Finding Your Slack Channel ID

You must specify a channel ID to send messages.

To find your Slack Channel ID:

  1. In Slack, right-click your channel name and select View channel details.

  2. Copy your Channel ID.

Testing "HELLO" Message to Channel

You can test sending messages to the Slack channel.

To test sending messages to a Slack Channel:

  1. Log in to your device’s web interface using HTTPS.

    HTTPS is required by Slack OAuth process.

  2. Go to the Advanced SettingsOAuth.

  3. Select your Slack profile from the Test OAuth Profile dropdown list.

  4. Select SLACK as the Provider Type Template.

  5. In the Data Payload, enter your Channel ID.

    {
      "channel": "<CHANNEL_ID>",
      "text": "HELLO!"
    }
  6. Select RUN OAuth Test.

    Upon success:

    • The message is posted to the Slack channel.


      A successful response is displayed.

Configuring an 8450 Button to Send Message to a SLACK Channel

You can configure a button on the Algo 8450 to send messages to a Slack channel using an existing OAuth profile.

To configure an 8450 button to send messages to a Slack Channel:

  1. Create a button on an 8450 screen.

  2. Set the Button Status to Enabled.

  3. Configure the following:

    • Text: Set to SLACK Message.

    • Action: Set to Send API Request.

    • Number of API Requests: Set to 1.

    • Request 1 - Command: Set to Other.

    • Request 1 - Method: Set to POST.

    • Request 1 - Custom Path: Set to api/chat.postMessage

    • Request 1 - Targets: Set to slack.com

    • Request 1 - OAuth Profile: Select your Slack profile.

    • Request 1 - Headers: Set to Custom Headers.

    • Request 1 - Custom Headers: Set to Content-Type: application/json; charset=utf-8

    • Request 1 - Data Payload: Enter the Channel ID and desired text.

      { "channel": "<Channel_ID>", "text": "HELLO" }
  4. Select Save.

    Press the button and verify that the message is posted to the Slack channel.

Troubleshooting

I get a 502 error when I run the OAuth Test

You may be logged out of your Algo device’s web interface. Log in again and retry

Why can’t I send messages to private channels?

Your user account must be invited to private channels first.

My OAuth profile stops working.

An OAuth profile can stop working if the OAuth provider rejects or invalidates the access or refresh token. Refer to the OAuth provider’s documentation for more information. If this occurs, the OAuth profile must be reauthorized.