Zoho FSM | Webhooks

Webhooks

Webhooks offer a way for you to establish communication between Zoho FSM and another application when an event occurs and exchange information about the event that occurred. A webhook is an event-notification via a HTTP URL. To trigger a webhook, you need to use it in conjunction with workflow rules.


 Available in Editions: Standard, Professional, Premium


Info
- Permission Required: Manage Automation
- Find out the Edition-specific limits for Webhooks.

Create Webhooks

To create a webhook:
  1. Navigate to Setup > Automation > Actions.
  2. Under the Webhooks tab, click Create Webhook.
  3. In the Create WebHook overlay, enter the following details and click Save.

    Field Name

    Action Required

    Name

    Enter a name for the webhook

    Description

    Provide details about the webhook

    Method

    The HTTP method that you want to use for the webhook. You can choose from GET (Retrieve), POST (Create), PUT (Update), and DELETE (Remove) methods.

    URL to Notify

    Specify the REST API URL from the application to which you want to send information.

    Authorization Type

    Choose an authorization method:

    • General (includes API Key or AUTH Token)

    • Connection

     

    You can either use an existing connection or new a new one. Click New Connection to create a new one. Once created, click on the Refresh icon [] to see the newly created connection listed.

    Module

    Select a module whose information you want to use in the webhook. The supported modules are:

    • Assets

    • Companies

    • Contacts

    • Estimates

    • Requests

    • Service Appointments

    • Services And Parts

    • Work Orders

    Headers

    Add any detail, if required that will convey some information about the request. Use module parameters to send dynamic values, and custom parameters for static values like authentication information.

    • Module Parameters: Click Add New Line and provide the Parameter Name, Parameter type, and Parameter Value.

    • Custom Parameters: Click Add New Line and provide the Parameter Name and Value.

    Body

    Add the information you want to pass through the Webhook URL. You can choose the format in which you want to pass the information. Either choose the Type as Form-Data or Raw.

    • Form-Data: Using this you can send key-value pairs. You can send these using the Module Parameters, Custom Parameters, and User defined Parameters. Use Module Parameters, and User defined Parameters to send dynamic values. Use Custom Parameters for static values.

      • Module Parameters: Click Add New Line and provide the Parameter Name, Parameter type, and Parameter Value.

      • Custom Parameters: Click Add New Line and provide the Parameter Name and Value.

      • User defined Parameters: Click Add New Line and provide the Parameter Name and Value. Use # or click Insert to add a placeholder. The placeholders will get replaced with actual values when the webhook is triggered.

    • Raw: Using this you can input data in the formats: XML, JSON, HTML, or TEXT. Use # to add a placeholder. The placeholders will get replaced with actual values when the webhook is triggered.

    Preview URL

    You can view the preview of the webhook URL constructed. Preview URL displays the complete webhook URL for GET and DELETE request method, while for the POST and PUT method, only the configured URL is displayed. Click on the Refresh icon [] to see the latest changes.

Associate with Workflow Rules     

You can either associate an existing webhook with the workflow or create a new webhook and associate it to the workflow.
 

Manage Webhooks   

You can edit or delete the webhooks.
 

Webhook Failures

When a workflow rule is triggered, its associated webhook is executed to send data to your third-party application. However, a webhook may occasionally fail to deliver for specific records. You can analyze and troubleshoot these instances using the Failures tab. The Failures tab can be accessed at Setup > Automation > Actions > Webhooks.

The Failures tab provides the following information:
  1. Webhook Name: The specific webhook that attempted to execute.
  2. Entity: The specific record (e.g., AP-144) that triggered the failure.
  3. Rule: The underlying automation rule that initiated the action.
  4. Module: The module (e.g., Requests, Service Appointments) where the record resides.
  5. Failure Time: The exact timestamp when the execution failed.
  6. Response Code: The HTTP status code returned by the destination server (e.g., 410, 403).

Example

When an asset is added to Zoho FSM, send an SMS to the contact with the warranty details. To implement this, follow the steps below:
  1. Create a webhook to send a SMS via Twilio.
  2. Create a workflow rule for triggering the webhook when a new Asset record is created.

Create a webhook

  1. Navigate to Setup > Automation > Webhooks and click Create Webhook.
  2. Perform the following, then click Save:
    1. Name: WarrantyDetails
    2. A suitable Description
    3. Method: POST
    4. URL to Notify: https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json
      Replace {AccountSid} with the actual value. Refer Twilio's API documentation for details.
    5. Authorization Type: Connection
    6. In the Choose Connection field, click New Connection. Select the newly created connection.
    7. Module: Assets



    8. Under Body, do the following:
      1. Type: Form-Data
      2. Click Add New Line for Module Parameters and enter the following parameter values:
        Parameter Name: To
        Module Name: Contact
        Field Name: Mobile
      3. Click Add New Line for Custom Parameters and enter the following:
        From: Your Twilio phone number
        StatusCallback: http://postb.in/1234abcd
      4. Click Add New Line for User defined Parameters and enter the following:
        Body: Dear ${!Assets.Contact.First_Name} ${!Assets.Contact.Last_Name}, The warranty for your Asset ${!Assets.Name} is valid till ${!Assets.Warranty_Expiration}. Thanks.


Create a Twilio Connection

  1. In My Connections page, click Create Connection.



  2. Under the Default Services tab, select Twilio.



  3. Enter the Connection Name as Twilio and click Create And Connect.
    The Connection Link Name will be automatically populated.



  4. Click Connect in the authentication page.



  5. Click Authorize in the Authorization page.



  6. Enter the Account SID and Auth Token and click Authorize.

Create a workflow

  1. Go to Setup > Automation > Workflow Rules and click Create Workflow.
  2. Enter the following details, then click Next:
    1. Module: Assets
    2. Rule Name: Send Warranty Details
    3. Description: When an asset is added to Zoho FSM, send an SMS to the contact with the warranty details.



  3. Select the rule trigger as Created and click Next.



  4. Select the rule criteria as To all Assets and click Next.



  5. Click +Action and select Webhook.



  6. Select Existing Webhooks and click Next.



  7. Select the webhook created earlier and click Next.



  8. Click Save.

Note: Ensure that the mobile number of the contact is formatted with a + and country code.