...
Siga los pasos a continuación para configurar su bot para que se comunique con los usuarios finales a través de la aplicación de mensajería de Slack:
Step 1: create an application
Sign in to the Slack workspace at https://slack.com/signin . If a workspace doesn't exist yet, create a new one.
Once you're signed in to your workspace, click the link below to create a Slack app channel.
https://api.slack.com/apps?new_app=1On the “Create a Slack App” screen, add your Slack app details.
App Name and select your Workspace .
Click the Create App button .
Note: In case you don't go directly to the Create a Slack App page . Click the Create New App button on the main Slack API page.
Once the Slack app is created, you will be redirected to the following screen:
Scroll down to App Credentials . This section contains the unique App ID , Client ID, Client Secret, and Signing Secret assigned to the application. The information is used to configure Slack as a chat channel in the Luma VSA tenant and allows the tenant to access the Slack API. Copy the App ID , Client ID, Client Secret, and Signing Secret
(Signature Secret) and keep the information in an easily accessible location, such as a notepad or any text editing tool. The information will later be used to configure and activate Slack in the Luma VSA.
Step 2: configure the Slack app
Once the application is created, the next step is to configure the application and provide the necessary permission to allow it to interact with the Luma bot. The required settings are shown below:
Add the endpoint URL in the Slack app. The Luma VSA RequestURL (Request URL) is added to the Slack app. To add the URL, follow the steps below:
Login to the Luma VSA tenant in the Bot Builder UI.
Vaya a la pestaña Channel (Canal) en el menú Bot (Bot) → Configurations (Configuraciones).
Haga clic en el ícono de Slack.
Ahora se lo redirigirá a la página Configure Channel (Configurar canal). Copie el valor en el campo RequestURL/RedirectURL y consérvelo en un bloc de notas o en alguna herramienta de edición de texto. La dirección URL se agregará a la aplicación de Slack en el paso siguiente.
Ahora en la página Slack API (API de Slack), vaya a la pestaña Event Subscription (Suscripción de eventos).
Cambie el botón Enable Events (Activar eventos) a On (Activado).
Agregue la RequestURL copiada en el paso 2 → 1(d) en el campo Request URL (URL de solicitud). La API de Slack enviará una solicitud al punto de conexión y verificará la dirección URL. Recién después de la verificación, Slack podrá conectarse con su inquilino.
Ahora, desplácese hacia abajo hasta Subscribe (Suscribirse) a eventos de bot.
Aquí nos suscribimos al bot “recibir eventos” como nuevos mensajes en el canal. Esto permite que Slack se comunique con Luma VSA. Puede suscribirse a eventos en función de las necesidades de su organización. Para obtener más información sobre todos los tipos de eventos, consulte https://api.slack.com/events. Para suscribirse a los eventos, haga lo siguiente:Haga clic en el botón Add Bot User Event (Agregar evento de usuario del bot).
Busque y agregue las siguientes suscripciones a eventos una por una.
member_joined_channel
member_left_channel
message.channels
message.groups
message.mpim
Haga clic en Save Changes (Guardar cambios).
The next step is to add OAuth and permissions.
Go to the OAuth & Permissions tab .
Click Add new Redirect URL . The redirect URL is required for authentication. The URLs in Luma VSA and Slack must match for the application configuration to be correct.
Add the RequestURL copied in step 2 → 1 (d) in the Redirect URLs field and click Add .
Click the Save URLs button .
After adding the URL, we add the scope. The app's capabilities and permissions to interact with Luma VSA are governed by the scopes requested.
Section Scopes (Scopes) → Bot Token Scope (Scope of the token of the bot) , click Add an OAuth Scope (Add a range of OAuth) and add the following scopes one by one .channels:history
channels:read
groups:history
groups:read
im:history
mpim:history
Section Scopes (Scopes) → UserToken Scope (Scope of the token of the user) , click Add an OAuth Scope (Add a range of OAuth) and add the following scope:
users.profile: read
Note that users.profile: read allows the Luma VSA to request user information from Slack to automatically authenticate the user.
The next step is to configure the interactive components, that is, activate the interactions between Slack and Luma VSA with the interactive components such as buttons, pick list, and more. To do this, follow the steps below:
Go to the Interactivity & Shortcuts tab .
Change the Interactivity button to On .
Add the RequestURL copied in step 2 → 1 (d) in the Request URL field. Slack will send an information request to this URL when users interact with an interactive component.
Click Save Changes .
Now go to the App Home tab and enable the following:
In the Your App's Presence in Slack section , turn Always Show My Bot as Online to On .
Section Show Tabs (Show tabs), select the tab Home tab (Home tab) .
Info |
---|
Cuando se actualizan los permisos de alcance de OAuth, es necesario volver a instalar la aplicación para que se apliquen los cambios. Haga clic en Reinstall your app (Reinstalar su aplicación), en caso de que Slack presente la siguiente solicitud. Luma VSA solicitará permiso para acceder a su espacio de trabajo de Slack. Se lo redirigirá a la página de solicitud de permiso (similar al Paso 3-->punto 7). Haga clic en el botón Allow(Permitir)para aceptar la solicitud de acceso.
|
Paso 3: configurar Slack en Luma
Ahora que la aplicación de Slack está lista, el siguiente paso es activar el canal de chat de Slack y enviar las credenciales en Luma VSA. Para ello, siga los siguientes pasos:
Inicie sesión en el inquilino de Luma VSA en la interfaz de usuario del Generador de bots.
Vaya a la pestaña Channel (Canal) en el menú Bot (Bot) → Configurations (Configuraciones).
Haga clic en el ícono de Slack.
En la página Configure Channel (Configurar canal), pegue los valores deApp ID (ID de la aplicación), Client ID (ID del cliente), Client Secret (Secreto de cliente) y Signing Secret (Secreto de firma) (conservados en el bloc de notas en el Paso 1 → 5) en sus respectivos campos.
Desplácese hacia abajo hasta la sección Reconciliación de usuarios para la autenticación de canales, para especificar los detalles del usuario que Luma VSA utilizará para conciliar y autenticar automáticamente a los usuarios que se conectan a través de Slack. Dado que Luma VSA utiliza la dirección de correo electrónico para autenticar a los usuarios a través de Slack, agregue los campos de Luma que pueden contener la dirección de correo electrónico del usuario.
Seleccione la información de usuario requerida en User Fields (Campos de usuario)
Haga clic en el botón Set (Establecer).
Puede agregar uno o más campos. Durante la conciliación o autenticación.
Una vez que se agregan los detalles, haga clic en el botón Configure (Configurar) para activar el canal.
Luma VSA solicitará permiso para acceder a su espacio de trabajo de Slack. Se lo redirigirá a la siguiente página.
Haga clic en el botón Allow(Permitir)para aceptar la solicitud de acceso. Aparecerá la siguiente página con un mensaje de confirmación.
Slack ahora está habilitado para su inquilino. Los usuarios finales pueden comunicarse con Luma VSA a través de Slack como un canal de chat.
...