Newer
Older
Integrate with Slack using VTAP.Oauth authentication.
Purpose : Give users option to send vtiger record details to a slack channel.
Details :
2. When the user clicks the button, we will show public channels available.
3. If authentication is not done, then it will prompt you to add oauth client details.
4. Create a oauth app(https://api.slack.com/apps?new_app=1), and enable channels:read from User Token Scopes and chat:write, chat:write.public scope from Bot Token Scopes.
5. Registered app in Slack will provide Client ID and Client Secret, copy them in the oauth client popup.
6. Add https://slack.com/oauth/v2/authorize for Auth URL and https://slack.com/api/oauth.v2.access for Token URL. Add "channels:read,chat:write" for scope.
7. After client details are saved, it will shown Slack screen for granting permission.
We need to add 2 api's in API Designer.
1. get_slack_channels.xml file has API details which will connect Slack using OAuth tokens and retrieves Channels.
2. send_record_to_slack.xml sends record details to particular Slack channel
Add a new extension module from Module Designer called SlackIntegration.
We need to add TAP Script with name "Register".
Register.js file has the contents of the script.
This script will add a widget in detail header page, two action link in more actions(3 dots in detail page).
The script is added with comments for every step for better understanding.