1.44 KB
Newer Older
Vikas's avatar
Vikas committed
1 2 3 4 5 6
Integrate with Slack using VTAP.Oauth authentication.

Purpose : Give users option to send vtiger record details to a slack channel.

Details : 

Vikas's avatar
Vikas committed
1. Provide button in detail page of a record.
Vikas's avatar
Vikas committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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(, 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 for Auth URL and 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.