Advanced message formatting options in Incoming Webhooks

Advanced message formatting options in Incoming Webhooks

Overview

You can keep your Posts simple as a single line of text, or present the information in a distinguished manner with the help of the advanced formatting options.  In the advanced formatting option, the JSON payload that you send to the Webhook URL will contain a few extra fields in addition to your text. The advanced formatting options is also supported for the comments.

How to post a message in a card format using Incoming Webhooks?

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

The parameter/JSON keys with a * next to them are mandatory ones.


JSON key
 Data type/Required format
 Description

title*
 P lain 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's URL
The maximum size limit is 1000 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.Kindly contact the service representative to proceed further ","card":{"title":"Micheal Ross","text":"*Designation* : Senior System Administrator <br> *Location* : California <br><b>Contact Number<b> : ************","thumbnail": "https://contacts.zoho.com/profile/image/434534534.png"}}

The JSON payload will post a message in the following format:

      

Slides

Instead of posting the data in a plain text format, you can use Slides to add images to it and present the data in a list or tabular view. 

Zoho Connect's Incoming Webhooks supports the following Slide formats.
  1. Table
  2. Label
  3. List
  4. Images
The  Basic Slide JSON format is as follows:

JSON key
 Data type/Required format
 Description/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 has a different JSON format. 
buttons
JSON
Details of the button.
A maximum of 5 buttons can be added to a Post.


How to post a message in a table format using Incoming Webhooks?

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

Parameters
 Data type/Required format
 Description/Example


headers*
 JSONArray(20)
["Header1","Header2","Header3"]
Each header can have maximum of a 100 characters.

rows*
 JSONArray(50)

[{"Header1":"value1","Header2":"Value2","Header3":"Value3"},

{"Header1":"value1","Header2":"Value2"},

{"Header1":"value1","Header3":"Value3"}]

Each value can have maximum of a 100 characters.

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

    Content-type: application/x-www-form-urlencoded

    {"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"}}}]}


The above JSON payload will post a message as follows:

      

How to post a message in a label format using an Incoming Webhook?

To post a message in a label format, s et the data JSON as shown in the example.
  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?zapikey=XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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": "[Revenue Report for Q1FY2017](https://www.zoho.com/connect/)" }, { "Q2 - FY2017": "[Revenue Report for Q2FY2017](https://www.zoho.com/connect/)" }, { "Q3 - FY2017": "[Revenue Report for Q3FY2017](https://www.zoho.com/connect/)" } ] } ] }


The JSON payload will post a message in the format  below:

      

How to post a message in a list format using an Incoming Webhook?

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

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

    Content-type: application/x-www-form-urlencoded

    payload - 

    { "message": "Hi Team! Take a look at the details about today 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" }, { "Josep": "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" }}}]}

The JSON payload will post a message in the format  below:
      
     

How to post a message with an embedded image?

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

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

    Content-type: application/x-www-form-urlencoded

    payload - { "message": "Report analysing the tourist visit trend (10 - 16 Sept 2019)", "slides": [ { "type": "images", "title": "Analysing the average number of days spent with the day of arrival.", "data": [ "https://www.zoho.com/cliq/help/restapi/images/WeeklyReport.png" ,"https://www.amcharts.com/wp-content/uploads/2018/11/demo_11322_none.png","https://d2mvzyuse3lwjc.cloudfront.net/doc/en/UserGuide/images/2D_B_and_W_Pie_Chart/2D_B_W_Pie_Chart_1.png?v=83139","https://www.microsoft.com/en-us/microsoft-365/blog/wp-content/uploads/sites/2/2012/06/Excel-charts-11.png","https://www.excel-easy.com/smi/examples/pivot-chart.png" ] } ] }

The JSON payload will post a message in the below format:

      


How to highlight a Post using Incoming Webhooks?

Posts that would require extra attention can be highlighted by setting the JSON style and the slides as shown in the example below.

JSON key
 Data type/Required format
 Description/Example


highlight*
   boolean
 Enter the input as "true" if you'd like to highlight the Post.


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

    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": "[Revenue Report for Q1FY2017](https://www.zoho.com/connect/)" }, { "Q2 - FY2017": "[Revenue Report for Q2FY2017](https://www.zoho.com/connect/)" }, { "Q3 - FY2017": "[Revenue Report for Q3FY2017](https://www.zoho.com/connect/)" } ] } ] ,"styles":{"highlight":"true"}}


The Post will be highlighted as follows:
      

      

How to add CTAs to a Post in Incoming Webhooks?

You can add CTAs to your Post by including the JSON in the payload parameter.



JSON key
 Data type/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 behaviour of the button.

CTA JSON:

JSON key
 Data type/Required format
 Description


type*

Operation type of the button.

data*
JSON

Operation data of the button.


CTA data

JSON key
Data type/Required format
  Description


Web*
URL
URL on click (from Web application)(256)
iOS
URL
U RL  on click (from iOS application)(256)
Android
URL
U RL  on click (from Android application)(256)


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

    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 stimulation\". Hit \"I'm in\" if you are 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" }}}]}

The JSON payload will post a message in the following format: