Creating Webhooks
Webhooks facilitates communication with third-party applications by sending instant web notifications every time an event occurs in Zoho CRM. With Webhooks, you can configure HTTP URLs and associate them in workflow rules to automate the entire notification process.
Scenarios
- After closing a deal in Zoho CRM, you can push the customer information to Accounting software (e.g. Zoho Books) and automatically generate an Invoice for the Customer.
- You can add subscribers to the mailing list in Email Marketing software (e. g. MailChimp) based on leads or contacts collected from your Website using Zoho CRM’s Web forms.
- You can trigger SMS reminders to field sales reps about customer meetings, demos and other events.
- You can generate an estimate in your Accounting software (e.g. Zoho Books) as soon as the opportunity stage is changed from Prospecting to Price Quote.
- After closing a deal in Zoho CRM, you can automatically calculate the commission for Sales Reps in Sales Commission Application built over Zoho Creator.
Target Audience
- CRM users with Manage Workflow permissions
- Programmers with REST API skills
Set Up Webhooks
Setting up Webhooks includes the following three steps:- Create a webhooks
- Associate webhook to a workflow rule
- Test webhook integration
- Go to Setup > Automation > Actions > Webhooks
- In the Webhooks page, click Configure Webhook
- In the New Webhook page, specify all necessary parameters
- Click Save
Recognize Unsupported Merge Field Values
Sometimes you may notice that the merge field values you have used in the Value Description editor of your webhook now get displayed as ${Unsupported_Field}. Following are some of the reasons why this happens.
Custom Field Deleted
The merge field whose value you have inserted has been deleted. If your webhook’s Value Description editor continues to contain the merge field value of a deleted field, that value will be displayed as ${Unsupported_Field}.
Custom Look-Up Field Deleted
The custom look up field whose value you have inserted has been deleted. If your webhook’s Value Description editor continues to contain the merge field value of a deleted look-up field, that value will be displayed as ${Unsupported_Field}.
Field Not Listed in the list of Available Merge Fields
If you have used the merge field value of a field that is not among the list of available merge fields for the selected module, then it will be displayed as ${Unsupported_Field}.
For example, if you insert the merge field value ${Leads.Lead Id} in the Value Description editor for the Deals module, it will get displayed as an unsupported field.
Integrations/Features Disabled
When a feature or integration has been disabled for your account, the fields that were created as part of the integration will also not be available for the account post the deactivation. If a merge field value of such a field has been inserted in the Value Description editor, it will be displayed as ${Unsupported_Field}. This is applicable to the following features/integrations.
- Google Ads Integration – Google Ads fields that are no longer available will not be supported.
- Visitor Tracking (Zoho SalesIQ Integration): Visitor Tracking fields that are no longer available will not be supported.
- Territory Management – Fields that are no longer available will not be supported.
- Multicurrency – Currencies that have been deactivated will not be supported.
To Associate a Webhook to a Workflow Rule
- Go to Setup > Automation > Workflow Rules
- In the Workflow Rules page, click the Create Rule.
- In the Create New Rule page, specify workflow rule parameters.
- Under Workflow Actions, select webhooks.
- In the Call Webhook popup, select the required webhook and click Associate.
- Click Save.
To Test the Webhook Integration
- Add test data in CRM according to your workflow rule criteria
- In your application check for the data received from Zoho CRM via webhook notification
- If there is an error or data mismatch, modify your webhook settings in Zoho CRM
- Continue this test until you obtain the required data from Zoho CRM to your Application
Important Notes
- You can associate up to 6 (1 Instant Action and 5 Time-Based Actions) webhooks per workflow rule.
- You can transfer data for a maximum of 10 CRM fields from Zoho CRM to third-party applications using webhook.
- You cannot retrieve data from other Apps to Zoho CRM using webhooks.
- You must update the API ticket regularly according to limits in third-party applications.
- You will not receive any email notification, if the Webhook integration stopped functioning due to any issue in a third-party API.
- In webhooks, we allow maximum 10000 characters for user defined format, while using the POST method.
- If there is any failure in the process, Webhook will send a notification first, Zoho CRM system will send a second notification after 15 min. Thereafter, the system will not send any Webhook notifications for that particular workflow trigger.
- If you exceed the maximum count per day, the system will not send remaining Webhook notifications to third-party applications and will notify the failure to Administrator.
- In the URL to Notify field, if you want to specify a port number, please note that only 80 or 443 port numbers are supported.
- Zoho CRM gives an option to select the required Date/Date Time format and Time Zone during Webhook param configuration.
- Limits for Webhooks:
- Professional edition – 50,000 calls/day or 100 calls/user/day (whichever is lower).
- Enterprise edition – 500,000 calls/day or 500 calls/user/day (whichever is lower).
- Ultimate edition – 1,000,000 calls/day or 1000 calls/user/day (whichever is lower).
Business Scenario 1
Calculate Sales Commission in Zoho Creator App upon closing an Opportunity in Zoho CRM
Purpose
Sales Managers and the Payroll team can use the Sales Commission app to calculate the compensation for your Sales Reps according to a pre-defined formula that is been set by your organization (for example, flat 2% of the closed contract or sales amount). This application helps you to reduce manual entries, minimize errors and save time while calculating the commission for your Sales Reps. Additionally, Sales Reps can track their monthly commissions in a central location.
Pre-Requisite
- Account in Zoho Creator Application
- Permission to access Zoho API
- Familiarity with Zoho Creator
Procedure
- Create the Sales Commission App in Zoho Creator Tutorial
- Configure Webhook in Zoho CRM
- Setup Workflow Rule
- Test your Webhook Integration
Step 1: Create Sales Commission App in Zoho Creator
In Zoho Creator, create the Sales Commission App with the following fields:
- Sales Rep
- Deal Name
- Customer Name
- Opportunity Amount
- Type of Business: New Business or Existing Business
- Closing Date
- Sales Commission
To create an Application in Zoho Creator refer to the online help
Step 2: Configure Webhook
Select the following fields from the Deal Module while setting up user-defined parameters
- Deal Name
- Closing Date
- Type
- Record Owner
- Amount
In Webhook, specify the following details:
URL to Notify:
- https.//creator.zoho.com/api/xml/write – POST method
User-defined Parameters (XML or JSON)
- <ZohoCreator>
- <applicationlist>
- <application name=’sales-commissions’>
- <formlist>
- <form name=’Commissions’>
- <add>
- <field name=’Name’>
- <value> ${Potentials.Potential Name} </value>
- </field>
- <field name=’Closed_Amount’>
- <value> ${Potentials.Amount} </value>
- </field>
- <field name=’Closing_Date’>
- <value> ${Potentials.Closing Date} </value>
- </field>
- <field name=’Customer_Name’>
- <value> ${Accounts.Account Name} </value>
- </field>
- <field name=’Type_of_Business’>
- <value> ${Potentials.Type} </value>
- </field>
- <field name=’Sales_Rep’>
- <value> ${Potentials.Potential Owner} </value></field>
- </add>
- </form>
- </formlist>
- </application>
- </applicationlist>
- </ZohoCreator>
- In the above XML string, name represents the field in Zoho Creator App and the value for data is to be pushed from Zoho CRM.
- <applicaton name> is the name of the application that contains the form in Zoho Creator. Get your application name from the Application Settings tab of Zoho Creator.
- <form name> is the name of the form where you edit records in Zoho Creator. Get your form name from the Form Settings of your Zoho Creator account.
- Ensure that the date format in the Creator app is in yyyy-MM-dd format. You can change the date format from the Application Settings of your Zoho Creator account.
Custom Parameters:
- To retrieve data from other apps to Zoho Creator, you must specify the username and authtoken of Zoho API. To generate Zoho API Information, refer to the online help
Step 3: Set up Workflow Rule
Follow these steps in the Workflow Rule page
- Setup workflow criteria as:
- Type is New Business
- Stage is Closed Won
- Click Next
- Select webhook as instant action
- In the Call Webhook popup, select the required webhook from the list and click Associate
- Save the workflow rule
Associate Webhook to Workflow Rule
Step 4: Test your Integration
- Add a test deal in CRM with Type and Stage fields as a New Business and Closed Won respectively. While entering test data, ensure that Amount, Closing Data, Record Owner, Account Name, and Deal Name are also entered.
- Open your Sales Commission App in Zoho Creator and check for the CRM data. If you’ve not received any data, modify the webhook configuration and continue testing. After successful testing remove test entries and roll-out this integration to your CRM users.
Business Scenario 2
Send SMS alerts to customers and sales reps
Purpose
A payment from a customer is due today. You can send an SMS with the payment due date, customer name, and amount details to your Sales Rep by associating webhook to time-based action in workflow rules
Pre-Requisite
- Account in SMS gateway service
- Permission to access Workflow Rules
Procedure
- Create an account in SMS gateway service
- Configure webhook in Zoho CRM
- Set up Workflow Rule
- Test your webhook integration
Step 1: Create an account in SMS gateway service
In your SMS gateway service, create an account and get these details to configure webhook:
- Sales Rep
- Deal Name
- Customer Name
- Opportunity Amount
- Type of Business: New Business
- Stage: Closed Won
- Payment Due Date (custom field)
- Bulk SMS
- Clickatell
- Screen Magic
- Valueleaf
- Solution Infini
You can buy SMS credits and API details from the above vendors
Step 2: Configure Webhook
Select the following Fields from the Leads module while setting up user-defined parameters:
- Domain Name of SMS gateway
- Username
- Auth Token
In webhook, specify the following details:
URL to Notify
- http:///smsgateway/post – POST method
User-defined Parameters (XML or JSON)
- http://www.screen-magic.com/” xmlns=”http://www.defns.com/”>
- xxxx@xxxxx.com
- SMS-Provider
- XXXXXXX
- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- “${User.Mobile}”>Hi ${User.Last Name}, Payment amount ${Potential.Amount} is due today from ${Account.Name}. Please contact ${Contact.Last Name} ASAP
- In the above XML string, we’ve used Screen Magic gateway for demonstration purpose
Step 3: Set up Workflow Rule
Follow these steps in the Workflow Rule page
- Set up workflow criteria as:
- Type as New Business
- Stage is Closed Won
- Choose Closing date
- Select the webhook as a time-based action
- Save workflow rule
Workflow Rule Criteria
Associate Webhook to Workflow Rule
Step 4: Test your Integration
- Add a test deal in CRM with Type and Payment Due Date fields as a Existing Business and Today respectively. While entering test data, ensure that Amount, Closing Data, Record Owner, Account Name and Deal Name are also entered.
- In your mobile phone check for the SMS alert
If you’ve not received SMS, modify the webhook configuration and continue testing. After successful testing, remove test entries and roll-out this integration to your CRM users.
Refer Error Codes
Webhook execution may sometimes fail due to one of the following reasons:
- Bad Request: A required parameter may be missing
- Unauthorized Request: An invalid Auth Token is provided
- Request Failed: Parameters were valid but request failed
- Page not Found: If the requested item doesn’t exist
- Third-Party Error: Due to a glitch in the third-party application
- Third-Party Server Not Available: Disconnection at the third-party API server
- Internal Process Failure: If there is an error in processing the webhook
- Day Limit Reached: If the org had reached the maximum limit for the day
- Invalid URL: If the URL is SSRF vulnerable or an invalid URL
- Socket Timeout: If the webhook is invoked but response is not received until 10 seconds
View Webhooks Usage Graph
Zoho CRM provides graphs that show the daily or weekly usage statistics of webhooks across various features. You can view the alert usage from Go to Setup > Automation > Actions > Webhooks
The More Info link provides detailed information on the usage stats. Please note that the graph will cover the usage stats of the past 7 days.