Message formats in Incoming Webhooks

Message formats in Incoming Webhooks

Overview

This document will help you with a few basic message formatting options in Incoming Webhooks, required parameters, the input data, and how to implement it.
Click here to learn about the basics of Incoming Webhooks.

What are the parameters supported?

Payload* - JSON
messageType - status/event/comment (default value is status)
streamId - long
commentId - Long
attachment - file

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

Ensure that the request is in "application/x-www-form-urlencoded" format. If not, an error message will be generated.

Markdown help

The contents of the key "message" supports basic HTML markdown:
  1. Bold - *content*
  2. Italics - _content_
  3. strike - ~content~
  4. underline - +content+
  5. anchor - [content](link)
  6. BlockQuote - !content
  7. highlight - `content` 

How to post a status using Incoming Webhooks?

To post a simple message using an Incoming webhook, set the payload parameter with following JSON keys:

JSON key
 Data type/Required format
    Description


message*
 String
 The message that has to be displayed
title
 String
 Post title

Example: 
  1. POST https://connect.zoho.com/webhook/v1/incoming/intranet/499400157703126?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 your administrator to proceed further."}

The message posted in the Group will be as follows:

      

How to post a message with a URL using Incoming Webhooks?

To post a message with an URL in it, set the payload parameter with following JSON keys:

JSON key
    Data type/Required format
 Description


message*
 String
 The message that has to be displayed
title
 String
 Post title
linkUrl
 URL
 Link to the data source

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

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

    Parameters:

    payload={"title":"New Feature","message":"Learn more about how adding the Zoho Projects integration in Connect can help you increase your productivity.","linkUrl":"https://www.youtube.com/watch?v=FfsDMdZIg4s"}


The message posted in the Group will be as follows:

      

How to post an event details using Incoming Webhooks?

To post an event using an Incoming Webhook, set the  payload parameter with following JSON keys:

JSON key
 Data type/Required format
    Description


eventTitle*

String

  Title of the event

eventDesc

String

 A brief d escription of the event

eventLocation

String

  Location of the Event

startDate*

YYYY-MM-DD, HH:MM

 Start date of the event

endDate

YYYY-MM-DD, HH:MM
 E nd date of the event 

allDay

boolean

 This can be used if the event is scheduled for the     entire day

You'll need to set the parameter messageType as event. If not, it will be considered as status by default.

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

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

    Parameters:

    payload {"eventTitle":"zoholics","eventDesc":"Tech event conducted between zoho developers and customers","eventLocation":"Bangalore","startDate":"2020-05-11 10:00","endDate":"2020-06-11 18:00"}

    message Type=event

The message posted in the Group will be as follows:
      
      
      
If it's an all day event include the JSON key and value  "allDay" : "true".

How to add a Comment using Incoming Webhook?

To post a comment using an Incoming Webhook, set the following JSON keys in payload paramter:

Parameter
Data type/Required format
 Description 

payload
JSON
Message in JSON format

messageType*

Comment

Message type of the Post. 

streamId*

String

Unique Id of the Feeds.

commentId

String

Unique Id of the comment to which reply comment should be added (in case you're replying to a comment).


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

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

    Parameters:

    payload={"message":" your request has been assigned to @Micheal@test.com"}

    messageType=comment

    streamId = 10500041******

How to mention a user in a Post?

To mention a user, use @ before their email address.
Example
  1. payload = {" message":" @zillum@zylker.com Please check the book cover and share your thoughts on it."," title","New book launch"}.

How to add a Tag?

Enter # before the word you would like to tag.

Example:
  1. payload = {"message":"The brochure for our book launch has finally arrived! #new launch"," title","New book launch"}.

Click here to know about the advanced formatting options in Incoming Webhooks like adding tables, embedding images, and a lot more.