Advanced Formatting messages in Incoming Webhooks

Advanced Formatting messages in Incoming Webhooks

Overview  

You can keep your posts as simple as a single line of text, or present information in a more distinguished way using advanced formatting options such as cards, tables, images, and buttons. With advanced formatting, the JSON payload you send to the webhook URL includes a few extra fields in addition to your message text. Advanced formatting is also supported for comments.

For the basic message formats, such as posting a status update, an event, or a comment, refer to Formatting Messages in Incoming Webhooks.

Posting a message in a card format  

To post a message in a card format, set the card JSON with the following keys in the payload parameter.

Notes
Keys marked with an asterisk ' * ' are mandatory.

JSON key

Data type or required format

Description

title*

Plain text/String

Title of the card. Maximum of 100 characters.

text*

HTML

Description of the card. Maximum of 200 characters. Supports basic HTML markdown.

thumbnail

Image URL

Maximum size limit is 1,000 KB.

Example:

  1. POST
    https://connect.zoho.com/webhook/v1/incoming/intranet/499400103126?zapikey=
    XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Content-Type: application/x-www-form-urlencoded
    payload={"message":"<b>Service Request</b><br><br>Your service request has been approved.
    Contact the service representative to proceed further.","card": {"title":"Michael Ross","text":"<i>Designation</i>:
    Senior System Administrator<br><i>Location</i>: California<br><b>Contact Number</b>: ************","thumbnail":


This payload will post a message in the format shown below.


Slides  

Instead of posting your data as plain text, you can use slides to add images and present data in a list or tabular view.

Incoming Webhooks in Zoho Connect support the following slide formats:

  • Table

  • Label

  • List

  • Images

The basic slide JSON format is as follows:

JSON key

Data type or required format

Description or example

type*

String

Table

title*

Plain text/String

Title of the card. Maximum of 100 characters.

text*

String (supports basic HTML markdown)

Description of the card. Maximum of 200 characters.

data*

JSON

Each slide type has a different JSON format.

buttons

JSON

Details of the button. You can add up to 5 buttons to a post.

Posting a message in a table format  

To post a message in a table format, set the data JSON as shown in the example.

Parameter

Data type or required format

Description or example

headers*

JSONArray (20)

["Header1","Header2","Header3"]. Each header can have a maximum of 100 characters.

rows*

JSONArray (50)

[{"Header1":"value1","Header2":"Value2","Header3":"Value3"},{"Header1":"value1","Header2":"Value2"},{"Header1":"value1","Header3":"Value3"}]. Each value can have a maximum of 100 characters.

Example:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey= XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Type: application/x-www-form-urlencoded
    payload={"card":{"title":"Zoho Connect top usage stats","text":"Daily usage stats of Zoho Connect. Start collaborating for better usage.","thumbnail":"https://help.com/wp-content/uploads/2018/03/1-11.png"},"slides":[{"type":"table","title":"29/03/2020 Zoho Connect usage stats","text":"Top 5 Zoho Connect users on 29/03/2020","data":{"headers":["Name","Posts","Views","Comments","Likes","Integrations"],"rows":[{"Name":"Mike Ross","Posts":"25","Views":"30","Comments":"10","Likes":"15","Integrations":3},{"Name":"Harvey Specter","Posts":"20","Views":"50","Comments":"8","Likes":"20","Integrations":0},{"Name":"Rachel","Posts":"15","Views":"10","Comments":"5","Likes":"25","Integrations":5},{"Name":"Donna","Posts":"5","Views":"5","Comments":"7","Likes":"0","Integrations":2},{"Name":"Joseph","Posts":"0","Views":"20","Comments":"4"}]}}],"buttons":[{"label":"View full report","hint":"View full usage stats","action":{"type":"open.url","data":{"web":"https://reports.zoho.com/zohoconnect/dailyusagestats"}}}]}


This payload will post a message in the format shown below.


Posting a message in a label format  

To post a message in a label format, set the data JSON as shown in the example.

Example:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey= XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Type: application/x-www-form-urlencoded
    payload={"message":"Hi team, take a look at the monthly financial reports attached.","slides":[{"type":"label","title":"Report for FY2017","data":[{"Q1 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q1FY2017</a>"},{"Q2 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q2FY2017</a>"},{"Q3 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q3FY2017</a>"}]}]}


This payload will post a message in the format shown below.

Posting a message in a list format  

To post a message in a list format, set the data JSON as shown in the example.

Example:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey= XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Type: application/x-www-form-urlencoded

    payload={"message":"Hi team, take a look at the details about today's meeting.","slides":[{"type":"list","title":"Key points","text":"Key points about today's meeting","data":["Time tracking for tasks","Prioritize requirements effectively","Identify and work on a fix for bugs instantly","Collaborate actively","Most important: keep it simple"]},{"type":"label","title":"Meeting panelist","data":[{"Dean Harvey":"Director, Engineering"},{"Joseph":"Director, Marketing"},{"Stephen":"Technology Analyst"}]}],"buttons":[{"label":"Accept","hint":"Accept invitation","action":{"type":"open.url","data":{"web":"https://calendar.zoho.com/zohoconnect/accept"}}},{"label":"Reject","hint":"Reject invitation","action":{"type":"open.url","data":{"web":"https://calendar.zoho.com/zohoconnect/reject"}}}]}


This payload will post a message in the format shown below.

Posting a message with an embedded image  

To post a message with an embedded image, set the data JSON as shown in the example.

Example:

This payload will post a message in the format shown below.

 

Highlighting a post  

You can highlight posts that need extra attention by setting the style JSON along with the slides, as shown in the example below.

JSON key

Data type or required format

Description or example

highlight*

Boolean

Enter true to highlight the post.


Example:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey= XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Type: application/x-www-form-urlencoded
    payload={"message":"Hi team, take a look at the monthly financial reports attached.","slides":[{"type":"label","title":"Report for FY2017","data":[{"Q1 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q1FY2017</a>"},{"Q2 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q2FY2017</a>"},{"Q3 - FY2017":"<a href=\"https://www.zoho.com/connect/\">Revenue Report for Q3FY2017</a>"}]}],"styles":{"highlight":"true"}}


This payload will highlight the post as shown below.

Adding CTAs to a post  

You can add calls to action (CTAs) to your post by including the following JSON in the payload parameter.

JSON key

Data type or required format

Description

label*

Text

Label of the button. Maximum of 20 characters.

hint

Text

Description of the button. Maximum of 100 characters.

action*

JSON

The behavior of the button.

CTA JSON:

JSON key

Data type or required format

Description

type*

open.url

Operation type of the button.

data*

JSON

Operation data of the button.

CTA data:

JSON key

Data type or required format

Description

web*

URL

URL to open on click, from a web application. Maximum of 256 characters.

iOS

URL

URL to open on click, from an iOS application. Maximum of 256 characters.

Android

URL

URL to open on click, from an Android application. Maximum of 256 characters.


Example:

  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey= XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Content-Type: application/x-www-form-urlencoded
    payload={"message":"Hi team, we've got a couple of tickets for an online seminar on \"Artificial Intelligence and Simulation\". Click \"I'm in\" if you're interested.","buttons":[{"label":"I'm in","hint":"Accept invitation","action":{"type":"open.url","data":{"web":"https://calendar.zoho.com/zohoconnect/accept"}}},{"label":"I'll pass","hint":"Reject invitation","action":{"type":"open.url","data":{"web":"https://calendar.zoho.com/zohoconnect/reject"}}}]}


This payload will post a message in the format shown below.

 

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