Athento offers integration with Slack to send automated messages related to documents.
This article explains how to integrate the two applications.
Obtaining the Slack bot token
To obtain the authentication token for the Slack bot in order to connect it with Athento, the following steps must be followed:
1. Create a bot if it was not already created before. To do so, go to https://api.slack.com/apps and click on the "Create New App" button. You must select the "From scratch" option and fill in the name and workspace where the bot will belong.
2. You will have to go to the "OAuth & Permissions" section and there give write permissions to the bot, in the Scopes > Bot Token Scopes section (the permission is called chat:write).
3. Finally, in the "OAuth Tokens for Your Workspace" part you must click on the "Install to Workspace" button and in the next step click on "Allow". Once installed, the "Bot User OAuth Token" will appear and you must copy and save it.
Configuring the Slack application in Athento
From the Team Applications tab, go to the Slack application. Click Add, and then paste the token generated in the previous step. You can use the "Check connection" button to make sure Athento is correctly connected to the bot:
Invite the application to the Slack channel you want to use it in
From the channel where you want messages to be sent, type @ and start typing the name of the bot you created in Slack. Select the bot from the list of options suggested by Slack.
Configure operation to send messages to Slack
You must install the op_send_to_slack_v2 operation.
The configuration options are:
-
Channel: here you must enter the name of the channel where you want the messages to be sent.
-
Message: this is the message to be sent in the channel.
Use document information in the message
You can use information from the document from which the operation is executed in the messages, for example: the name of the document, the link, field values, etc.
Include the link to the document
{{ fil.get_url_file_view() }}
Include the value of a field in the message
{{ fil.gmv('metadata.AQUI-VA-EL-NOMBRE-DE-TU-CAMPO') }}
Other tags you can use
{{ fil.filename }} --> nombre del documento
{{ fil.creation_date }} --> fecha de creación del documento
{{ fil.state }} --> estado del documento
Example message:
Nueva reclamación creada a fecha {{fil.creation_date}}
con título {{fil.filename}} y estado {{fil.state}}.
Email del interesado: {{fil.gmv('metadata.formulario_1_email_interesado')}}.
Link al documento: {{fil.get_url_file_view()}}
And when the operation is launched, the bot will send a message via slack like this:
Formatting in messages
You can use basic formatting elements supported by Slack in your messages
Comments
0 comments
Please sign in to leave a comment.