WhatsApp Integration

Integrate WhatsApp with ServiceDesk Plus to help users connect with help desk technicians, receive notifications, and access support seamlessly right from their WhatsApp.

The following is a step by step guide on how to integrate WhatsApp with ServiceDesk Plus On-Premises.



Pre-Requisites :

 

  1. Facebook account to create a business account.

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

  3. A Meta developer account.

  4. Meta Business account.

  5. A WhatsApp business account.

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

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

 

 

Creating Meta Business Account

 

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

  2. Enter the business details, such as business name, business email, and etc. Click Submit.

  3. 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 a mobile and create an account using this mobile number.

  4. Once verified, try creating a business account again on business.facebook.com.

  5. Once the account gets created, it will be redirected to the business's landing page as shown below.

 

 

(Business Account landing page)

 

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

 

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

 

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

 

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

 

 

10. On the next page, enter the app name as "ServiceDesk Plus". The app contact email is the address where all communications related to this app will be sent. Please enter the address accordingly.

 

 

 

11. Once all the details are entered, click on Create app. Once created, it will be redirected to the app's configuration page. Click Set Up in the WhatsApp product.

 


12. On the WhatsApp product configuration page, 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. Once the WhatsApp product is added to the app, you can proceed with the API setup.

14. Click on API setup under WhatsApp in the left pane. In the send and receive messages section, click on the From number drop-down and choose Add phone number.

 

 

 

15. 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 is verified, it'll get added to the app, and you can use it now to send or receive messages.

 

18. Now, on the API setup page, copy both Phone Number ID and Business account ID and save them. They'll be required later.

 

 

 

19. Now click on Webhooks in the left pane. Choose WhatsApp Business Account in the drop-down and click on Subscribe to this object.

 

 

20. 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 you ServiceDesk Plus domain.

 

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

https://servicedeskplus.com/AppIntegrations?serviceName=whatsapp

 

 

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

 

 

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

 

 

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

 

 

 

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

 

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

 

 

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

 

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

 

 

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

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

 

 

30. Once the token has been generated, copy and keep it stored.

 

Configuring ServiceDesk Plus : 

 

  1. Head to Admin > Integrations > Third party > WhatsApp inside the ServiceDesk Plus application.

  2. Fill the value of the Phone Number ID with the Phone Number ID copied from step number 18 of the previous section.

  3. Fill the value of the Business Phone Number with the number of your WhatsApp business.

  4. In the Access Token field, fill in the value of the token copied and stored in step 30 of the previous section.

  5. Paste the value of the App Secret copied in step 23 in the Access Token field.

  6. Now in the SDP Hosted Domain field, if your ServiceDesk Plus instance's alias URL is already a publicly hosted URL, you can leave it unfilled as it will get auto-populated from the alias URL once saved. If not, you can edit the field and fill in the publicly hosted domain of ServiceDesk Plus.

  7. Once all the fields are filled, click on Save.

 

 

  1. Once saved, you'll have two tabs: Setup: To change/update the configuration, and Feature Configurations: To enable or disable certain features available offered in this integration. All the toggles in the Feature Configurations tab will be on by default.

 

  1. Enable/Disable Integration: You can toggle the WhatsApp Integration on/off with this toggle.

 

a. Bot Commands: The users can interact with the bot using various bot commands. Toggling this setting off will disable all the bot commands for the users.

 

b. Request Notifications: This integration offers notification through WhatsApp feature where Technicians will be notified when a request is assigned to them and Technician/Users will be notified when an request approval is raised to them. Disabling this feature will disable notifications through WhatsApp.

 

c. Chat With Technician: Users can initiate a chat session with available technicians in ServiceDesk Plus right from their WhatsApp using this feature. Disabling this will prevent the users from initiating a chat from WhatsApp.

 

d. Authentication via Email OTP: Users can authorise themselves with the bot through two methods: One is where an One-Time Password (OTP) will be sent to the user's primary email address if the outgoing mail server is configured and the user has an email address mapped to him/her.

The other way when outgoing mail server is not configured is where the user will be asked to login using their ServiceDesk Plus credentials. Toggling this setting off will set the authentication method as login credentials instead of Email OTP.

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).


Send a message to your business phone number to initiate the authentication process.

Please refer to the screenshots below for the initial authentication process:

1. Send a message to the Business Phone Number:

 

2. Check your primary mail for the mail with a One-Time Password:

 

3. Reply to the bot with the OTP to authenticate:



4. Once authenticated, you'll be shown an option to choose your desired instance; if you want to perform the operations in another instance than the default, click on Next Portal and then select that portal.

5. Once done, you'll have a welcome message with the Bot commands option:


 

Bot Commands:


The bot commands that are being offered to the users are:


1. Create a New Request

2. My Open Requests

3. My pending approvals

4. Change instance

5. Chat with Technician


 

  1. Create New Request: This option allows the user to create a request right from their WhatsApp. The user will be asked to enter the subject of the request first and then the description in detail subsequently. Once both are filled, a request will be created in the ServiceDesk Plus instance.

You can click on View Details to check the status of your request along with the other details. You'll also have an option to add a note to the request or initiate a chat with an available technician in ServiceDesk Plus:

 

  1. My Open Requests: This will return the list of open requests for the user. On the details card, the user will have an option to view more details of the request or move to the next open request if available.

 

  1. My pending approvals: As the name suggests, this option will list the pending approvals of the user. The user will have an option to approve/reject the approvals in the details card.

 

  1. Change Instance: Change Instance will allow users to set their instance/portal to perform their actions on. On the details card, Clicking on Select this portal button will set the instance, whereas Next portal will show the next available instance to choose.

  1. Chat with Technician: (Available to requesters alone) This button will initiate a chat in ServiceDesk Plus with technicians. Once an available technician accepts your chat, further messages from your WhatsApp will be considered as chat messages, until the chat session ends. Use the command '/end chat' to end the chat session.

  1. Request Notifications: Technicians will get notified when a request is assigned to them, provided that their WhatsApp number is mapped to the ServiceDesk Plus user. Similarly, when an approval request is raised, the user/technician will get notified in their WhatsApp. The /disable_notifications command disables notifications for that specific user, while the /enable_notifications command turns them back on.

 

Important Note:

1. Revoking user authentication :

To revoke the authentication mapped between the WhatsApp user and the ServiceDesk Plus user, '/revoke' command will do the job. The next time the revoked user sends a message to the bot, the initial authentication process will happen.

As per Meta, a valid payment method is required to be associated with the business account to ensure constant delivery of notifications. If not, the notifications will not be delivered after 3 days until the end user messages the bot again.

 

 

 


References :

 

1. Getting started with Business APIs

2. Meta developer account creation

3. Business App creation

4. Access tokens and System users

5. Business App Webhooks

6. Business Management APIs all references

7. WhatsApp Business Platform pricing details