Extension Pointers: Configure a Webhook to handle real-time updates between Zoho CRM and SurveyMonkey

Extension Pointers: Configure a Webhook to handle real-time updates between Zoho CRM and SurveyMonkey

While seamless data exchange is possible between Zoho CRM and third-party applications using connectors or custom variables as the binding knot, managing data updates in real-time lies a step ahead. Webhooks can help with this, as they serve as web callbacks to provide real-time data updates between applications on the occurrence of an event. To learn about Webhooks in more detail, please refer here.

In this post, we'll look at an example that depicts a Zoho CRM inbound webhook. This webhook sends data updates to Zoho CRM in real time, based on the occurrence of an event in the integrated third-party application, SurveyMonkey.

Let's assume a scenario where a survey created with SurveyMonkey will be sent to the Zoho CRM contact after successful completion of a deal in order to obtain their feedback. The inbound webhook in our example would be configured to trigger a post action whenever the contact responds to and completes the survey. This response will be updated in real-time to the Zoho CRM account, which could be used to make further data manipulations as per business requirements.

Let's take a look at the major pointers that will be explained in this example to create an inbound webhook and achieve the above mentioned functionality:

➤ Establish a connection between Zoho CRM and SurveyMonkey
➤ Define a REST API function that needs to be subscribed with SurveyMonkey
➤ Create and test your webhook

Establishing Connection between Zoho CRM and SurveyMonkey
  • Create a connector to integrate SurveyMonkey with Zoho CRM. SurveyMonkey supports OAuth method for user authentication. Please refer here to find the detailed steps involved in creating a connector.
  • Define the webhook API of SurveyMonkey with the specified parameters to create a webhook, along with the other essential API's (Get all survey details, Get survey details by ID).

SurveyMonkey Connector's API details:

Refer to the API documentation of SurveyMonkey for header and body parameter specifications of the APIs. After creating the connector and adding the API, publish and associate it with your respective extension.

Note: SurveyMonkey Webhooks can be configured for various events. For our example, we have subscribed the event "response-completed" for Surveys. Whenever a user completes responding to a survey, callback will happen, which in turn will trigger the REST API function.

Defining a Rest API function

SurveyMonkey webhook requires a subscription URL to be constructed as one of the parameters for the Create Webhook API. In order to obtain this URL, we need to define a REST API function that is capable of being triggered from the SurveyMonkey application during callback. The Survey Monkey webhook that will be configured (steps included in the upcoming parts of the post) will deliver the response to the subscribed REST API function. You can access this response through the REST API function input parameter and handle them as per your business process requirements.

1. Log in to Zoho Sigma, then go to the Extension Details page.
2. Choose Functions under Automate from the left panel of the Zoho Developer console under Build, then click New Function.
3. Enter the name of the function. Choose Yes for the Invoke as REST API option to create the function as a REST API function.

4. Click Next, then enter the code in the Deluge editor.

Note: Once the webhook is created successfully, this REST API function will also be successfully subscribed with the third party. When the subscribed event (survey completion) occurs, the third-party will perform the callback and the response will be sent to this function. The response format may vary between third-party applications. Based on the third-party application that you integrate with, extract the required data from the response using the input parameter, crmAPIRequest of the REST API function. The value can be acquired using the different data types as mentioned in this post. After retrieving the required values, data manipulations can be performed according to business logic.

5. Click Save & Close.

After defining the code for the REST API function, click Invoke as REST API button to obtain the URL. The sandbox URL provided with the zapi key value can be used to test the functionality locally in the sandbox environment. The production URL displayed along with the value of zapi key will serve as the subscription URL while creating the Webhook. The zapi key acts as the REST API function's method of authentication.

Creating the webhook

Create a webhook by passing the required values needed for the Webhook API. In our example, we have chosen to create the webhook and subscribe the REST API function during the authorization of the connector.

Note: You have the option to perform actions through custom function while installing an extension, uninstalling an extension, authorizing a connector, or revoking a connector. You can choose the best option that fits your needs.

1. Choose Connectors under Install Actions from the left panel of the Zoho Developer console under Build.

2. Choose On Authorization. Enter the code functionality to be performed during the connector authorization.

Code snippet

// Fetching the value of the ZAPI key to be appended in the subscription url
m = {"nameSpace":"xxx.surveymonkey4"};
apikeyresp = zoho.crm.invokeConnector("crm.zapikey",m);
zapikey = apikeyresp.get("response");

// Invoking the Get Surveys API call
resp = zoho.crm.invokeConnector("surveymonkey4.surveymonkeyconnector.getsurveys",dynamic_map1);
response = resp.get("response");
data = response.get("data");
for each dataa in data

// Retrieving the survey ID from response of the Get Surveys API call 
id = dataa.get("id");
info id;
dynamic_map = Map();

// Assigning the ID retrieved to the object_id parameter

// Assigning the combined value of url and zapikey obtained to URL parameter 
dynamic_map.put("url",{REST API URL} + zapikey);

// Invoking Create webhook API to subscribe the webhook with SurveyMonkey
resp = zoho.crm.invokeConnector("surveymonkey4.surveymonkeyconnector.createwebhook",dynamic_map);
return "";

➤ The Zapi keyvalue is obtained and stored in a variable called zapikey.
➤ The Get Surveys API call of the SurveyMonkey connector is invoked, and the survey ID is obtained from its response. The retrieved ID is assigned to the object_id parameter required for the Create Webhook API.
➤ Similarly, the url parameter required for the Create Webhook API call is assigned with the value obtained by appending the url (Production URL) and zapikey variable values fetched earlier.
➤ The Create Webhook API of the connector is invoked using zoho.crm.invokeConnector after constructing the required parameters.
➤ The webhook will be subscribed with SurveyMonkey when the connector is authorized and real-time updates can flow in from SurveyMonkey to Zoho CRM.

You can choose to further enhance the functionality by performing data manipulations on the response received from a third-party application via the REST API function, according to your business needs. For more information on extension, keep following this space.


    Zoho Marketing Automation
          • Sticky Posts

          • Extension Pointers: Configure a Webhook to handle real-time updates between Zoho CRM and SurveyMonkey

            While seamless data exchange is possible between Zoho CRM and third-party applications using connectors or custom variables as the binding knot, managing data updates in real-time lies a step ahead. Webhooks can help with this, as they serve as web callbacks
          • Here's what you can do with your DocuSign Extension

            Contracts, agreements, and other documents have always been an integral, concluding part of any sales process. With the free DocuSign Extension for Zoho CRM, we've made certain that your signing process is entirely digital, and there is no need for copies, fax, delivery services or postage.   Here are some of the features of our free DocuSign Extension:   Not just PDF Converting your agreements to PDF, and re-aligning them again is not an ideal use of your time. The DocuSign Extension makes it possible
          • Contact Info Extractor Chrome plugin

            Just trying out the Contact Info Extractor plugin and had a quick observation.  Since a target website for this plugin would be LinkedIn, I'm very surprised that the plugin cannot determine that if the selected text in question includes... Joe Smith Vice President at ABC Corporation ... the plugin can recognize the name and title but not the company.  I'd assume that the term "at" would give it the needed clue but on several contacts I tried to add, it's just not catching it. Would love to see the
          • Easily send documents from Egnyte to your leads in Zoho CRM

            Understanding your customers and educating them about your product are two sides of the same sales coin. During a sales process, to educate your potentials about your product, you may have to send them user guides, help documents, comparison sheets, and white papers. During negotiation, price quotes and invoice documents might also be sent. While the whole lead-qualifying process can be updated in your CRM, sending and receiving the documents needs some extra help. Things can get cumbersome over
          • Empower Your Sales Team with Email Marketing Insights Using the Mailchimp Extension

            Email marketing is one of the most powerful tools available for engaging leads. It’s low cost and high ROI makes it a top choice for marketers who want to establish contact with leads. But these leads can only be turned into actionable deals when pursued by salespeople.  The MailChimp extension for Zoho CRM gives salespeople access to leads generated via email marketing efforts. This eases the process of having to manually sift through leads to contact them and eliminates the need to import leads

          Zoho Pagesense Resources

            Zoho SalesIQ Resources

                  Zoho TeamInbox Resources

                    Zoho DataPrep Resources

                      Zoho CRM Plus Resources

                        Zoho Books Resources

                          Zoho Subscriptions Resources

                            Zoho Desk Resources

                              Zoho Projects Resources

                                Zoho Sprints Resources

                                  Qntrl Resources

                                    Zoho Creator Resources

                                      Zoho WorkDrive Resources

                                          Zoho Campaigns Resources

                                            Zoho CRM Resources

                                                    Design. Discuss. Deliver.

                                                    Create visually engaging stories with Zoho Show.

                                                    Get Started Now