Important - this is an advanced integration that requires expertise in Zoho Desk and Zoho Flow. If you're unfamiliar with these platforms, we strongly recommend working with a Zoho partner to ensure a smooth setup process. |
Streamline your customer support operations by incorporating SMS communication using the Sinch MessageMedia integration for Zoho Desk.
Take a look at this short video to see the SMS for Zoho Desk integration in action:
Requirements
- You'll need a post-paid Sinch MessageMedia account with a dedicated number - if you're new to Sinch MessageMedia, you can register for an account here.
- The integration requires advanced features in Zoho Desk and Zoho Flow which aren't available in the free version - so at a minimum, you'll need the following editions:
-
- Zoho Flow: Standard Edition
- Zoho Desk: Professional Edition
-
Step 1 | Configuring Fields in Zoho Desk
We are going to add a new section (SMS) with two fields to your Zoho Desk ticket layout - please read this article if you are unfamiliar with modifying layouts in Zoho Desk.
Make sure you enter the field names exactly as is shown here:
A) New section: SMS (the name can be adjusted)
B) New Multiline field: "SMS Content to send" (the name must be exactly as stated)
C) New Checkbox field: "Send SMS" (the name must be exactly as stated)
D) New Checkbox field: "Send SMS" (the name must be exactly as stated)
After adding these fields to your ticket layout, confirm the API names by going to the Fields List. The API names should be as shown.
If they are different, you will need to take note of the API names and change parts of the code that we will be adding later in the process.
Find your Zoho Desk org ID
Get your Zoho Desk org ID from the API settings page. Make note of it: you will need it later.
Find your Zoho Desk data center
Check the URL of your Zoho Desk instance. Open any page in Zoho Desk and check the zoho domain extension being used.
For example, in the Australian data center, the URL looks like this: https://desk.zoho.com.au/agent/mmaudemo/mm-au-demo/tickets/details/10499000000375507
(note zoho.com.au)
The code examples that follow use the Australian data center but you can change it if you are in a different Zoho data center.
Set up a connection between Zoho Flow and Zoho Desk
You'll need to set up a connection between Zoho Flow and Zoho Desk. From Settings > Connections, click Create Connection.
Search for Zoho Desk and click Next.
Name the connection Zoho Desk SMS (A), choose All triggers and actions (B) and then click Authorize (C).
Important note: We highly recommend that you call the connection "Zoho Desk SMS". If you call it something else, you will have to alter the code in subsequent steps.
Setting up the flows in Zoho Flow
Setting up a folder in Zoho Flow
Begin by opening Zoho Flow and creating a new folder for the flows in Zoho Flow.
Setting up the flow for inbound messages
1. Open the folder and create a new flow for the inbound message functionality.
2. Give it a meaningful name:
3. Choose webhook as the trigger
4. Choose JSON and then copy the webhook URL
5. Next we'll set up a webhook in Sinch MessageMedia. Follow these instructions to get to the webhook configuration page.
Configure the webhook as follows:
Events: the webhook should be triggered for inbound SMS and inbound MMS.
Headers: none are needed
Parameters: map the parameters as in the screenshot below
message_id: $mtId
last_outbound_message: $mtContent
from_number: $sourceAddress
inbound_message: $moContent
Save the webhook.
7. Test the webhook:
In Zoho Flow, click the Test button and then send a message from your phone to your Sinch MessageMedia dedicated number. You should see a payload like this appear.
8. Click done
9. Create a custom function for handling inbound SMS:
Review these instructions for creating a custom function.
Here is the code for the function
Important notes
a. If you are in a non Australian data center, you'll need to change the URL at the end in the invoke URL section from desk.zoho.com.au to your data center (e.g. desk.zoho.com or desk.zoho.in)
b. You must have already set up the Zoho Desk connection (see the Preparation steps above). If you called the connection something other than "zoho_desk_sms", you will need to change the code accordingly.
10. Add the function to the flow and map parameters
Drag the function into the flow and map the webhook payload (A) and enter your Zoho Desk org ID (B).
11. Turn on the flow
The flow should look like this. Turn it on when you're ready.
12. Test the flow
Send another inbound SMS to the dedicated number. It should create a ticket in Zoho Desk and if you reply again, it should add a comment to the ticket.
Setting up the flow for outbound messages
Now that you've got inbound messages working, it's time to set up outbound messages.
1. Create a new flow
Call it Handle outbound SMS. It will eventually look like this.
2. Set Ticket updated as the trigger for the flow
Choose Zoho Desk as the triggering app and "Ticket updated" as the trigger.
Use the following config:
A: Choose the connection you created earlier
B: Choose the relevant Zoho Desk portal
C: Choose the relevant Zoho Desk department
D: Choose the Send SMS field as the trigger (this is the checkbox you created earlier)
E: Set up the filter criteria as per the screenshot:
- SMS Content to send is not null; AND
- Send SMS equals true; AND
- SMS Activated equals true
3. Add another custom function for validating the message to be sent
Create a function in the same way that you did for inbound SMS.
4. Map parameters to the check_that_message_can_be_sent function
Map parameters from the Zoho Desk ticket update trigger:
A: map the ticket ID
B: map the SMS content to send field
C: map the Send_SMS field
D: map the ticket channel
E: enter the Zoho Desk org ID
5. Execute the function to generate sample output
Click the Execute button, enter some representative data and click Execute:
Check that the output looks correct by clicking on the output tab (A) and examining the result (B). If it looks similar, click Use this test data (C).
6. Add a Send Message action from MessageMedia
Map the parameters as follows:
A: Source number can be left blank if you are happy to use the default sender ID from your Sinch MessageMedia account. Otherwise you can specify a source number.
B: Map the Mobile field from the check_that_message_can_be_sent. Note if you can't see a Mobile field, it means you haven't done step 5 correctly (executing the function and choosing the test data).
C: Map the SMS Content to send field from the Zoho Desk ticket trigger.
7. Add another function to add the SMS as a comment in the ticket and clear the fields
Here is the code. You'll need to amend the data center URL if you are outside Australia.
8. Map the parameters for the create_comment_and_clear_outbound_value function:
A: ticket_id: map to the ID of the Zoho Desk ticket trigger
B: sms_content: map to the SMS content to send field from the Zoho Desk ticket trigger
C: desk_org_id: enter your Zoho Desk org ID.
9. Check that your flow looks correct and turn it on
Your flow should look like this. If it does, turn it on.
10. Test it by triggering an SMS from Zoho Desk
Using the ticket that was created earlier while testing inbound SMS, test a manual outbound SMS by entering the SMS content to send (A), ticking the Send SMS checkbox (B) and click Save (C). You should receive an SMS and there should be a new comment added to the ticket.
(Optional) Setting up a flow to auto respond to inbound messages
If you'd like to automatically respond to inbound SMS with the ticket number, you can set up another flow.
1. Create a new flow
Call it something like "Auto reply to first inbound SMS"
2. Set up a Zoho Desk create ticket trigger
This is similar to the trigger for outbound SMS but this time it will be triggered by a new ticket being created where the Subject starts with SMS with +. This will therefore be triggered by the tickets that are created by our inbound SMS flow.
3. Drag in the check_that_message_can_be_sent function
Map the parameters in a similar way to the outbound SMS flow:
There are some slight differences.
A: sms_content: This time you will enter the message you want to send rather than mapping it from the ticket.
B: send_sms_state: Set this to true
C: channel: Set this to SMS via Zoho Flow
D: desk_org_id: Set your Zoho Desk org ID.
4. Add a MessageMedia Send Message action
Similar to the outbound message flow:
A: set the mobile field from the check_that_message_can_be_sent function
B: put in the message you want to send (you can include merge fields from the ticket)
5. Add the create_comment_and_clear_outbound_value function:
Map the parameters as follows:
A: ticket_id: map to the ID of the Zoho Desk ticket that triggered the flow
B: sms_content: Enter the message you are sending (you could also map the Content parameter from the MessageMedia Send Message action)
C: desk_org_id: enter your Zoho Desk org ID
All done! Enjoy the customer support benefits of handling SMS from Zoho Desk 🙂
Comments
0 comments
Please sign in to leave a comment.