Hello everyone!
Welcome back to another week in the Kaizen series!
This week, we will discuss webhooks in detail.
What are webhooks?
Webhooks facilitate communication with third-party applications by sending instant web notifications every time an event occurs in Zoho CRM. With Webhooks, you can configure the HTTP URLs and associate them in workflow rules to automate the entire notification process.
Click here to know how to create a webhook.
Custom Function as a Webhook
You can trigger a custom function from any third-party application when you make it available as a webhook.
Example:
We are going to configure a third-party system to automatically create a quote in Zoho CRM when a deal amount is less than 1000 OR the deal stage is closed-won , thus avoiding manual intervention . We already have a custom function in place that performs the above actions. Now, to trigger the custom function from a third-party application, we need to make it available as a webhook .
1. Go to Setup > Developer Space > Functions
2. Choose the function (DealToQuote()) > Click more options > Click REST API
3. Enter the API name for the function.
4. Enable API key to share the function as a webhook with any third-party user.
Click Save .
You can configure the URL received here as a webhook in the third party application.
Here is an instance of how you can trigger the custom function from a third-party application:
Note: Enable OAuth2.0 to trigger the custom function using the OAuth2.0 access token , instead of the zapikey. OAuth2.0 option is best suited when you want to share the function as an API for users within your organization .
Possible Errors
Error
| Description
|
INVALID_DATA - 202: Value is empty and 'get' function cannot be applied
| The parameter/input value specified is incorrect.
|
INVALID_URL_PATTERN - 404: Please check if the URL trying to access is a correct one
| The request URL specified is incorrect.
|
INVALID_REQUEST - 400: unable to process your request. please verify whether you have entered proper method name, parameter and parameter values.
| Either the method name, parameter name, or parameter value is incorrect (or) you have not specified valid authentication details (auth_type: apikey)
|
INVALID_TOKEN - 401: invalid oauth token
| The OAuth token specified is incorrect. Specify the valid zapikey in the request.
|
INVALID_DATA - 202: Value is empty and 'toLong' function cannot be applied
| You have not specified one or more parameters/input values.
|
INVALID_REQUEST_METHOD - 400: The http request method type is not a valid one
| The HTTP request method specified is incorrect.
|
We hope you found this post useful.
Write to us at support@zohocrm.com if you have any questions, or let us know in the comment section.
Cheers!