You seem to like what you read...
Why not subscribe to our newsletter?
Receive this type of content and many others (tools, news, testimonials, podcasts…) every week directly to the mailbox of your choice. Unsubscribe at any time.
On Slack, your chatbot will be materialized by an application that you will need to create and configure .
Open your web browser and sign in to Slack, via this link: https://slack.com/signin . If everything went well, you will see your workspace displayed.
Enter the following URL in your browser: https://api.slack.com/apps . This takes you to the “Your Apps” page:
Click on the “Create New App” button in the center of the page (this can also be at the top right of this page if you have already created other applications before).
A new window appears asking you for basic information about your application: its name and the Slack workspace in which you want it to be accessible. Enter this information and click “Create App” .
You are then redirected to the main page of your new Slack application; this is where it all happens!
First thing to do here, scroll down the page until you get to the “App Credentials” section and more specifically the “App ID” (it’s kind of your app’s security number , through which Slack can identify the latter). write it down somewhere (in the 21st century you’ll probably want to copy-paste it into a temporary text file 😉 ), you’ll need it later.
Optional: On this page, you can also add an icon and description to your Slack app. To do this, scroll down the page to the “Display Information” section and fill in the fields as desired. Click the “Save Changes” button if you want to save these optional settings.
In the left side menu, click on “ OAuth & Permissions ”; you then arrive on the page for managing the permissions available to your Bot, materialized in Slack by scopes .
Scroll down the page to the “Scopes” section. We will add the five scopes that the Slack app needs to be fully compatible with Vizir. Click on the “Add an OAuth Scope” button. In the field that appears, then type “chat” in order to make suggestions appear. Then click on the “chat:write” suggestion. This new scope is then added to the list. Do the same to add the “im:history”, “files:read”, “users:read”, and “users:read:email” scopes . You should then have the following result:
In the left menu, click on “App Home” (first item of the “Features” section), in the “How Your App Displays” section, activate the option “Always Show My Bot as Online” because a bot must be on deck 24 hours a day, 7 days a week. (In this section you can also change the name under which your bot will appear in your Slack workspace.)
You must provide Slack with the information that will allow it to communicate to your Bot Vizier the events of interest (ex: a message sent by a user).
To do this, in the left menu, click on “ Event Subscriptions”. You then arrive on a page which presents you with an “Enable Events” selector; click on it to change it from “Off” to “On”.
New elements are then displayed on the page. Fill in the “Request URL” field with the following value:
https://developers.vizir.co/slack/messages
Once the address has been entered, click on the page where you want outside this field; Slack will then launch a test request. If everything went well, you will see a confirmation message as shown in the following image:
Then, further down the page, click on “Subscribe to bot events” to expand the corresponding section. Here, click on the “ Add Bot User Event ” button and in the field that opens, search for “message.im” and “app_home_opened”. The section should finally look like this:
Validate these latest changes via the “Save Changes” button (on the right, at the bottom of the page).
Finally, via the left side menu, go to the “Interactive Components” page. You will see a simple description message appear along with (top right) a selector ; click on the latter so that it changes to “On” .
Then fill in the “Request URL” field as before, namely: https://developers.vizir.co/slack/messages
Again, click the “Save Changes” button at the bottom of the page to save this change .
Once configured, your Bot is ready to run in your Slack workspace. In the left side menu, click on “Install App”, then, once arrived on the corresponding page, click on the “Install App to Workspace “.
A page then appears asking you to authorize the permissions requested by your Bot. Click “Allow” (or “Allow”).
You are then redirected to a page presenting a ” Bot User OAuth Access Token ” field. Write it down, alongside the previously noted App ID .
In 4), you gave Slack the necessary information to communicate with your Bot Vizier. Now, we are going to enable communication in the other direction: from your Bot Vizir to your Slack application. Go to your Vizir Dashboard and select the Bot you want to link to the Slack app you just created. Via the left side menu, go to the “Sharing” page .
Scroll down the page to the “Slack” section where you will find an edit (“pen”) button that you need to click .
There then appear two fields to fill in. This is when you are going to need the temporary text file filled in earlier (or your piece of paper :)). Indeed, as its name suggests, the ” APPID” field will receive the App ID of your Slack application (retrieved in 1)); the ” APP SECRET” field must be filled in with the Bot User OAuth Access Token, retrieved in 5). Normally, the “Slack” section of the page should now look like this (your changes are automatically saved when you click elsewhere on the screen):
Security advice: As you won’t need it for the rest, it is strongly recommended to get rid of the temporary file (or to tear up the piece of paper ;)) where you noted the App ID and the Bot User OAuth Access Token from your Slack app.
Finally, click “Publish” at the top right of the window to save these changes.
You are now ready to test that everything is working fine. For information, your collaborators who want to converse with this Bot via Slack must also follow the rest of these instructions.
Go to your Slack workspace (the one where you created your linked Slack application now linked to your Bot Vizir). Click the “+” button , next to the “Direct Messages” section . In the search box that appears, start typing your Bot’s name and select it from the list that appears .
Click “Go”. Your conversation with the Bot Vizier then starts.
Vous pouvez converser ici avec le Bot de la même manière que vous le faites sur le chat web de Vizir. Comme vous l’avez probablement constaté (et vous pouvez le voir sur l’image précédente), le nom de votre Bot est apparu dans la section “Applications” du volet latéral de Slack. C’est en cliquant sur ce dernier que vous pourrez à tout moment reprendre votre conversation avec le Bot.
Bonus: Lorsqu’un utilisateur communique avec votre bot Vizir via Slack, vous avez accès aux informations Slack de celui-ci (à la condition bien sûr qu’il ait rempli ces informations sur son profil Slack). Voici la liste des attributs pré-remplis par slack :
Vous trouverez plus d’infos à leur sujet dans la documentation de Slack.
Ce qui veut dire que vous pouvez, par exemple, accueillir votre répondant sur Slack avec une resource contenant le message “Bonjour {{real_name}}, comment puis-je vous aider ?” et ainsi offrir un accueil personnalisé.
WARNING : si vous aviez créé un attribut qui porte l’un des noms ci-dessus, je vous conseille de le modifier pour éviter l’écrasement de sa valeur par la valeur de l’attribut récupéré via slack.
Book a 1 to 1 demo
with a Vizir expert and discover what a
chatbot can do for you.
Receive this type of content and many others (tools, news, testimonials, podcasts…) every week directly to the mailbox of your choice. Unsubscribe at any time.