WhatsApp Integration with ServiceDesk Plus

WhatsApp Integration with ServiceDesk Plus



This article will guide you through the steps of installing the WhatsApp Integration with ServiceDesk Plus plugin.


Note:  This integration is compatible with versions above 14600.



Pre-Requisites :


  1. Facebook account to create a business account.


  1. Ensure that your ServiceDesk Plus instance is hosted publicly with a valid SSL certificate.


  1. A Meta developer account. If there's not one, this article will have the steps to create one.


  1. Meta Business account. If there's not one, this article will have the steps to create one.


  1. A WhatsApp business account. If there's not one, this article will have the steps to create one.


  1. A valid ID proof for the Meta review process.


  1. A WhatsApp business number or a number that is not associated with a WhatsApp business yet.



Once the pre-requisites are sorted out, we can proceed with the configuration. We'll start with a Meta business account creation, if not one available already.



  1. To create a Meta business account, head to https://business.facebook.com and login with the Facebook account. Once logged in, click on Create an account to proceed with the business account creation.


  1. We'll be asked to enter the business details such as business name, business email, and so forth. Fill in those values and click on Submit.


  1. If there's trouble signing up for the business account or the registration throws an error, try verifying the mobile number associated with the Facebook account. To verify, install the WhatsApp business app on an mobile and create an account using this mobile number. 


  1. Once verified, try creating a business account again in business.facebook.com.


  1. Once the account is created, we'll be redirected to the business's landing page as shown below.


(business account landing page)


  1. Once a business account has been created, head to https://developers.facebook.com and click on My Apps on the top-right corner.


  1. Under the My Apps section, click on Create App in the top-right corner.


  1. Once inside the app creation page, choose Other and click on Next.


  1. In the next page, choose Business as the type of the app and click on Next.



10. In the next page, enter the app name as "ServiceDesk Plus". The app contact email is the mail address to which all communications regarding this app will arrive. Please enter the address accordingly.




11. Once all the details are entered, click on Create app. Once created, we'll be redirected to the app's configuration page where we'll be asked to choose the product to be added to the app. Click on Set Up under the WhatsApp product.




12. we'll be redirected to the WhatsApp product configuration page where at the beginning we'll be asked to create a WhatsApp business account. Follow the on-screen instructions to create one.



(In case there's an error saying that the business account has been restricted, please check your mail for any intimations from Meta regarding the same. The mail will have an option to appeal the restriction. You'll be asked to submit a valid ID proof for the appealing process)


13. The WhatsApp product has been successfully added to the app. Now onto the next step in the configuration.


14. Click on API setup under WhatsApp in the left pane. Under the Send and Receive messages section, click on the From number drop-down and choose Add a new number.




15. We'll be asked to enter the details of the WhatsApp business profile. Enter the name as ServiceDesk Plus and choose the business category as Other. Click on Next.




16. In the next step, enter the business number. Choose how to verify the number and click on Next to initiate the verification process.



17. After the number has been verified, it'll get added to the app and we can use it now to send and receive messages.


18. Now, on the API setup page, copy both Phone Number ID and Business account ID and keep it saved. They'll be required further down the process.



19. Now click on App settings in the left pane and choose Basic. In the settings page, copy the App secret and keep it stored somewhere as it'll be required later.




20. Now head to business.facebook.com and click on Business settings in the bottom-left corner. We'll be redirected to the business settings page.


21. Now inside business settings, under Users, click on System users and click on Add.


22. Provide the name of the user as "ServiceDesk Plus" and system user role as "employee".


23. Now click on Assign assets and choose Apps. Choose the ServiceDesk Plus app and enable Full control.




24. Now click on Generate New Token and under the App drop-down, select the ServiceDesk Plus app.



25. Under Expiry, choose Never and under Permissions, select"whatsapp_business_management and "whatsapp_business_messaging" permissions. Click on Generate Token.



26. Once the token has generated, copy and keep it stored somewhere.


We have completed configuring the Meta app for our integration. Now onto configuring the ServiceDesk Plus plugin.


(We still have to configure webhooks in the Meta app, which we'll be configuring after the restart of the ServiceDesk Plus server)




Configuring ServiceDesk Plus : 


  1. The plugin files have been attached along with this article. Download and extract the zip file.


  1. Move the SDPPlugin_WhatsAppHandler.jar file to ServiceDesk Plus - > integration - > lib directory


  1. Create a new folder named 'whatsapp' under "<SDP_Home>/integration/resources" directory. Move the "whatsapp.html" and "sdp-mobileapp-logo.png" files from the zip to this 'whatsapp' directory.


  1. Move the "security-plugin.xml" to the "<SDP_Home>/integration/resources/WEB-INF/security" directory, replacing the existing "security-plugin.xml" file.


  1. Move the "AppIntegrations_Handler_Custom.xml" file to the "<SDP_Home>/integration/conf" directory.


  1. Open the "whatsappConf.json" file from the extracted folder. Replace the parameters in the JSON with the values obtained earlier :


  1. Replace "businessID" with your WhatsApp business account ID.

.

  1. Replace "appSecret" with your app secret.
  2. Replace "accessToken" with the access token obtained earlier.


  1. Replace "phoneNumberID" with your phone number ID.


  1. Replace "businessPhoneNumber" with your business phone number.


  1. Replace "hostedDomain" with your ServiceDesk Plus hosted domain.


  1. Save the file and move it to the "ServiceDesk Plus/integration/conf" directory.



Feature Configurations:


Within the AppIntegrations_Handler_Custom.xml file, there exist two default parameters: OTPLogin and notification.


1. OTPLogin enables user authorization via One Time Password, requiring an user's email address to be filled.

2. The notification parameter triggers alerts for technicians when requests are assigned or when an approval is needed.


If both features are necessary, maintain their default values; otherwise, adjust the parameters to false.


Once all configurations are completed and transferred, restart the ServiceDesk Plus server to complete the successful installation of the WhatsApp Plugin.



Configuring Webhooks in Meta :

1. Go to your Meta app's configuration page and click on Webhooks in the left pane. Choose WhatsApp Business Account in the drop-down and click on Subscribe to this object.





2. In the callback URL, provide the URL in the below format :

https://<sdp_hosted_domain>/AppIntegrations?serviceName=whatsapp

(where <sdp_hosted_domain> is the URL of your ServiceDesk Plus hosted domain)


For example, if the hosted domain is https://servicedeskplus.com, then the callback URL will be :



3. In the verify token field, provide the value as "sdpTokenVerification". Once both are filled, click on Verify and save.





4. Once saved, scroll down and subscribe to the 'messages' event.





We've succesfully configured a webhook for our ServiceDesk Plus app.
​


Before proceeding with integration, ensure that user profiles in ServiceDesk Plus contain valid entries for mobile numbers and primary email addresses. For the mobile number, enter it with the country code but without the plus sign (e.g., 91xxxxxxxxxx, where 91 represents the country code).



To finalise, send a message from your WhatsApp to the Business phone number to initiate the authorization process.



Security Notes:

1. The appSecret and accessToken are stored plainly within the whatsapp.json file. Ensure restricted access to this file and consider enabling password protection for added security.


2. /revoke command will revoke the user authorisation.




To get an idea of what is available with this integration, check out this article.




References/FAQ :


1. Getting started with Business APIs  : 

https://developers.facebook.com/docs/whatsapp/cloud-api/get-started

2. Meta developer account creation : 

https://developers.facebook.com/docs/development/register


3. Business App creation : 

https://developers.facebook.com/docs/development/create-an-app/


4. Access tokens and System users :

https://developers.facebook.com/docs/whatsapp/business-management-api/get-started#system-users


5. Business App Webhooks :

https://developers.facebook.com/docs/whatsapp/business-management-api/guides/set-up-webhooks


5. Business Management APIs all references :

https://developers.facebook.com/docs/whatsapp/business-management-api/reference


6. Verifying your business account (to have a green checkmark) : 

https://developers.facebook.com/docs/whatsapp/overview/business-accounts/#official-business-account

                  New to ADSelfService Plus?

                    • Related Articles

                    • How to integrate ServiceDesk Plus MSP with WhatsApp business.

                      This article provides steps for integrating ServiceDesk plus MSP with WhatsApp (business). Note: This integration is compatible with versions 14600 & above. Before you begin, ensure you've reviewed the following prerequisites: Ensure your ServiceDesk ...
                    • WhatsApp Integration via Twilio (Notification only)

                      WhatsApp Integration via Twilio You can now integrate ServiceDesk Plus MSP with WhatsApp to trigger WhatsApp notifications to ServiceDesk Plus MSP technicians/users on the latest events that happen in the application. This can be done through Twilio ...
                    • WhatsApp Integration with ServiceDesk Plus via Twilio

                      This article provides steps for integrating ServiceDesk On-Premises with WhatsApp. Note: This integration is compatible with versions above 14600. Before you begin, ensure you've reviewed the following prerequisites: Ensure your ServiceDesk Plus ...
                    • Features available In WhatsApp Integration With ServiceDesk Plus

                      WhatsApp Integration with ServiceDesk Plus - What's Available? This article will guide through the features available with the WhatsApp plugin and how to make use of them. 1. Create a request : This option allows a requester or a technician to create ...
                    • Jira Integration

                      Jira Integration JIRA Integrates with ServiceDesk Plus MSP using "Request Custom Menu". Sample Implementation is already done and bundled with our application. You need to change field names as per your requirement in JIRA.xml. So When a ticket is ...