Configuring Incoming Webhooks

Configuring Incoming Webhooks

Feature Availability




Overview  

Incoming webhooks let you post messages from external applications directly into a Zoho Connect group. When an event occurs in another app, such as a form submission, a code update, or a payment received, a message is posted to your group automatically.

Getting started with Incoming Webhooks  

Each webhook has a unique URL. Send a JSON payload in the required format from your external application to this URL, and the data will be posted in your Zoho Connect group. This lets you track and stay notified about activities in your other applications without leaving Zoho Connect.

Key features of Incoming Webhooks  

Feature

Description

Configuration


Incoming webhooks are available only at the group level

Compatibility

Any application that can send an HTTPS POST request can send messages using incoming webhooks

Markdown support

Messages in the payload support basic HTML markdown. To learn more, see Message formats in incoming webhooks.

Attachments

You can add up to 10 files to a post. The size limit per file is 10 MB

Who can use the Incoming Webhook integration?  

Incoming webhooks are available to all members in the network. However, the network admin can enable or disable this integration at any time.

 Incoming Webhook limits 

A network's members and admins can create up to 50 incoming webhooks per day on the Enterprise plan, with up to 1,000 webhook executions per day. On the Ultimate plan, a network can create up to 100 incoming webhooks per day, with up to 10,000 webhook executions per day.

Notes A member can create a maximum of 20 incoming webhooks per day.

How to approve/restrict Incoming Webhook integration

The network admin can approve or restrict the integration by following the steps below:

  1. Click the Integrations icon from the right side menu.



  2. Click Manage from the left menu.



  3. Navigate to Incoming Webhook and click the toggle to approve or restrict.


Once the network admin restricts the integration, members in the network can neither configure a new webhook nor use an existing one.

How to configure an Incoming Webhook

  1. Click the Integrations icon from the right side menu.



  2. Scroll through the list and click Incoming Webhook.



  3. Click Configure.

     

  1. Select the group or board where you want to post messages.



  2. Enter a name for the webhook and upload an image.



  3. Click Save.

A webhook URL will appear below the configuration. Messages from other applications will be sent to this URL. The URL is specific to the group you selected. Copy the webhook URL and store it securely.

How to post a status using an Incoming Webhook

Send an HTTPS POST request to your webhook URL in the following format:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/{intranet_id}?
    zapikey=XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     
    Content-Type: application/x-www-form-urlencoded 
     payload={"message":"Your message here"}

Example:

  1. payload={"message":"<b>Service Request</b><br><br>Your service request has been approved.
     Kindly contact your administrator to proceed further."}


Once the request is made, a message will be posted in the configured group.




Info

 The request must use "application/x-www-form-urlencoded" as the content type. Any other format will return an error.

For more message types and formatting options, see Message formats in incoming webhooks.

Response codes for a post made using an Incoming Webhook  

On success

Status code: HTTP 200

  1. {"status":"success","id":"unique id of post/comment created"}


On failure

Status code: HTTP 400

  1. {"status":"failure","errorCode":"EXTRA_KEY_FOUND",
    "reason":"Extra key found in theJSON parameter payload"}

Custom Function in Incoming Webhooks  

Every application has its own format to send and receive data. If your request doesn't fit any of the pre-defined formats, you can write a custom function to structure it into the format Zoho Connect expects. If you've written a custom function, the map it returns will be used as the input for the webhook.

To write a custom function:

  1. Click the Integrations icon from the right side menu.



  2. Scroll through the list and click Incoming Webhook.



  3. Click Configure to create a new webhook, or open an existing one.



  4. Click Edit configuration.



  5. Navigate to Custom Function and click Write function.



  6. Write your code in the editor pop-up.



  7. Click Save.

Info

The custom function requires network admin authentication before other members in the network can use it.

The following parameters should be passed to the custom function during runtime:

Parameter

Type

Description

params

Map

Key-value pair of all parameters sent with the request

headers

Map

Key-value pair of all headers of the request

body

String

Content written in the body of the request

network

Map

Key-value pair of details about the current network

Network detail example:

  1. { "createdBy":{"name":"mark","emailId":"mark@zillum.com", "id":"142283" },
    "domain":"
    zillum.com", "
    name":"zillum Network", "id":"22000000002002", "type":"2", // 2 for intranet ,
    4 for extranet "plan":"2",//0 for free, 1 for trial and 2 for enterprise
    "url":"
    https://connect.zoho.com/portal/intranet" }

 

Response codes for a Custom Function  

Function executed and post added successfully

  1. { "customFunctionResponse": {"message": {"userMessage": []},
    "output": {"payload":{"message": "Testing Content",
    "linkUrl": "
    https://connect.zoho.com/portal/intranet"}},"status": "success"},
    "status":"success",
    "id": "3000000577088" }
Function executed successfully but failed while adding post
  1. { "customFunctionResponse": {"message": {"userMessage": []},"output": {"payload":{"message": "Testing Content","value":"Content for test"},"streamId":"3000000577088","messageType":"comment"},"status": "success"},

    " status ": "failure",
    " errorCode ": "1044",

    "reason ": "Extra key found in the JSON value" }

Function execution failed

  1. { "customFunctionResponse": {"status": "failure"},
    " status ": "failure",
    " errorCode ": "1045",
    " reason ": "Unable to execute custom function" }

 

How to protect your Webhook URL 

Anyone with the webhook URL can post messages to your group. Don't share it publicly. If the URL is exposed, you can regenerate it at any time.

To regenerate the webhook URL:

  1. Click the Integrations icon from the right side menu.



  2. Navigate to Incoming Webhook.



  3. Open the required webhook.



  4. Click Edit configuration.



  5. In the configuration page, click Regenerate in the bottom-right corner.



If you have any questions related to Incoming Webhooks, write to us at support@zohoconnect.com. We're happy to help!