Difference between revisions of "Configuring Notifications with Slack"

From WHMCS Documentation

(Configuring Slack Notifications)
Line 9: Line 9:
 
You can create an OAuth Access Token quickly and easily by following the steps below.
 
You can create an OAuth Access Token quickly and easily by following the steps below.
  
===Installing the WHMCS App to your Slack Workspace===
+
===Creating an App for Slack===
  
 
1. Begin by visiting https://api.slack.com/
 
1. Begin by visiting https://api.slack.com/
  
2. Click the '''Start Building''' button to start the process of creating a new app.
+
2. Click the '''Start Building''' button to start the process of creating a new app. You will need to login if you haven't already.
  
 
3. Enter a name for the app.  We recommend something like 'WHMCS'.  Also choose the workspace you wish to add the app to. Then click continue.
 
3. Enter a name for the app.  We recommend something like 'WHMCS'.  Also choose the workspace you wish to add the app to. Then click continue.
Line 21: Line 21:
 
[[File:Slack-permissions.png]]
 
[[File:Slack-permissions.png]]
  
5. On the following screen, scroll to the Scopes section and add the following two scopes:
+
5. On the following screen, scroll or auto-search to the Scopes section and add the following two scopes:
  
 
* Access information about user’s public channels (''channels:read'')
 
* Access information about user’s public channels (''channels:read'')
Line 48: Line 48:
 
12. Under the Slack notification provider, click '''Configure'''
 
12. Under the Slack notification provider, click '''Configure'''
  
13. Enter the OAuth Access Token you copied in step 10 where requested and hit '''Save Changes''' to complete the process.
+
13. Enter the OAuth Access Token you copied in step 10 into the OAuth Access Token input field and hit '''Save Changes''' to complete the process.
  
WHMCS will attempt to verify the OAuth Access Token provided. If the verification fails you will receive an error message. Check the Access Token is entered correctly, has all the required scopes and try again. If successful, the modal will close and Slack will change to active.
+
WHMCS will attempt to verify the OAuth Access Token provided. If the verification fails you will receive an error message. Check the Access Token is entered correctly, has all the required scopes and try again. If successful, the modal will close and you will now be able to send notifications to Slack.
  
 
You are now ready to [[Notifications#Creating_a_Notification_Rule|Create Your First Notification Rule]].
 
You are now ready to [[Notifications#Creating_a_Notification_Rule|Create Your First Notification Rule]].

Revision as of 13:06, 25 October 2017

Configuring Notifications with Slack allows you to receive notifications in your Slack channels when events occur within WHMCS.

For more information on Notifications, please refer to the Notifications Documentation.

Configuring Slack Notifications

To enable WHMCS to communicate with the Slack API, WHMCS requires an OAuth Access Token.

You can create an OAuth Access Token quickly and easily by following the steps below.

Creating an App for Slack

1. Begin by visiting https://api.slack.com/

2. Click the Start Building button to start the process of creating a new app. You will need to login if you haven't already.

3. Enter a name for the app. We recommend something like 'WHMCS'. Also choose the workspace you wish to add the app to. Then click continue.

4. Under the Add features and functionality heading, select the Permissions option.

Slack-permissions.png

5. On the following screen, scroll or auto-search to the Scopes section and add the following two scopes:

  • Access information about user’s public channels (channels:read)
  • Send messages as WHMCS (chat:write:bot)

Slack-scopes.png

6. Click Save Changes

7. Now navigate to Install App in the sidebar.

Slack-install.png

8. Click the Install App button.

9. Confirm you authorize the permissions for the app that you just configured.

Slack-authorize.png

10. You will now be presented with the OAuth Access Token you need for WHMCS integration. Copy this value.

Slack-oauth-token.png

11. Now return to WHMCS and navigate to Setup > Notifications.

12. Under the Slack notification provider, click Configure

13. Enter the OAuth Access Token you copied in step 10 into the OAuth Access Token input field and hit Save Changes to complete the process.

WHMCS will attempt to verify the OAuth Access Token provided. If the verification fails you will receive an error message. Check the Access Token is entered correctly, has all the required scopes and try again. If successful, the modal will close and you will now be able to send notifications to Slack.

You are now ready to Create Your First Notification Rule.