-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started
This is a walkthrough for the initial configuration step you would require to get your own Slack bot with Frappe!
Follow the steps once you have finished installation of frappe-slack-connector
in your Frappe installation.
NOTE: All the tokens, names and 'secrets' are for demonstration purposes only. They were created for this documentation and are not valid.
To begin integrating the Frappe Slack connector with your Slack workspace, head over to the Slack App Dashboard and create a new app.
On the next screen, select From Scratch to create a custom app.
Choose the App name and the Slack workspace where you want the app to be installed.
Once your app is created, you will be directed to the app's dashboard where you can find all the essential details.
We would require these credentials in the next part of setting up.
For handling interactivity such as Slack actions or modals, enter your Frappe app's URL in the Interactivity section.
The URL should be: https://<your_domain_here>/api/method/frappe_slack_connector.api.slack_interactions.event
To allow users to apply for leaves via a Slack command, go to Slash Commands and add your custom command.
Define the command you want to use, for example /apply_leave
, and configure it according to your Frappe app’s endpoint.
The URL should be: https://<your_domain_here>/api/method/frappe_slack_connector.api.slash_leave.slash_leave
From Basic Information tab in sidebar, you can customize the appearance of the app by uploading an icon, app name, and other display preferences.
Once all configurations are done, now it's time to Install App to add it to your workspace. Just to do that, we have to set up OAuth Scope, i.e, the permissions the Bot would have on your Workspace.
To configure that, navigate to OAuth and Permissions
tab from the sidebar.
In the OAuth & Permissions section, add the required scopes that the your app needs to function correctly.
Add permissions for:
- channels:history
- channels:read
- chat:write
- commands
- users:read
- users:read.email
After adding scopes, install or reinstall the app to the workspace.
You will be prompted to approve the app for your workspace by clicking Allow.
NOTE: You have to reinstall the app everytime the OAuth Permissions are changed.
Once installed, you will receive a bot token that will be used to authenticate requests between Slack and your Frappe app.
In your Frappe app's settings, update the Slack configurations.
Check the information from the initial screen and fill these up in the settings page
- Bot Token
- App Token (not used, currently you can just use the Bot token here too)
- Signing Token
- Attendance Channel ID
- and the Time you'd want the attendance updates
NOTE: The bot needs to be invited to the Slack Channel before it can send messages. You can mention the bot in the channel and slack will add it. Also, after saving the configuration page, click on test channel to send a test message on the aforementioned channel so as to check the bot is able to send messages properly.
Once the integration is complete, you will see a confirmation similar to the one below.
All the users who are connected with Slack are synced (you can see in User Meta
DocType shipped with the module).
The users who are not connected to slack and also the ones connected to slack but not on ERP are displayed. You can recheck this list from the Error Log List
.
Following these steps will allow you to integrate the Frappe Slack connector successfully and start using it for leave management directly within Slack!
For running the app locally, you'd want to use ngrok and use a free tunnel to connect Slack with your localhost.
Also, look into our other dev-tools for developing, debugging and hosting frappe apps: frappe-manager
Created with <3 by rtCamp