Choose where you’d like to start

Add a post

Overview

This task can be used to post to a group in Zoho Connect. The user gets to post a status, an event, and a task.

Syntax

<variable> = zoho.connect.addPost(<type>, <scopeID>, <partitionID>, <contentMap>, <connectionName>);

where,

ParameterDescriptionData type

<variable>

is the variable which will hold returned repsonse.

The response will contain the message status and the Stream ID of the posted message

KEY-VALUE

<type>

is the variable that denotes the type of the post.

Applicable values for this parameter are:

  • status
  • event
  • task
TEXT

<scopeID>

is the variable which represents the Scope ID of the network where the message will be posted.

You can also fetch the scope ID from the response of myNetworks task.

NUMBER

<partitionID>

is the variable which represents the Partition ID of the network where the message will be posted.

You can also fetch the partition ID from the response of myGroups task.

NUMBER

<contentMap>

is the variable which will hold the contents of the post.

Applicable keys are specified in the table below.

KEY-VALUE

<connectionName>

(optional)*

is the name of the Zoho connect connection.

*Note: This param is not applicable to Zoho Creator and mandatory in Zoho Cliq.

TEXT

Applicable keys for contentMap param

To post a status
Key nameData typeMaximum lengthDescription
message*HTML Text25000

Content to be posted as Status(Supports basic Html tags which are supported in editor)

titleTEXT300

Title of the status

linkUrlTEXT500

Url to be posted as link Info

To post an event
Key nameData typeMaximum lengthDescription
eventTitle*Text250

Title of the event

eventDescText1000

Description of the event

eventLocationText250

Location of the event

invitedUsersText2000

CSV of user email Ids - to invite user

invitedUserIdsJSONArray2000

Json Array of zuid - to invite user

invitedGroupIdsJSONArray2000

Json Array of partitionId - to invite group

startDate*Text100

Start date of event in "yyyy-MM-dd HH:mm" format

endDate*Text100

end date of event in "yyyy-MM-dd HH:mm" format

allDayBoolean-

whether the event is All day or not

To post a task
Key nameData typeMaximum lengthDescription

taskTitle* 

**Task can create inside board only

Text250 Title of the task
taskDescText500

Description of the task

sectionIdNumber250

Id of the section inside a board

priorityNone|Low|Medium|High-

Priority of the task

assignedUsersText2000

CSV of user email Ids - to assign user(if empty task creator will be assigned by default)

assignedUserIdsJSONArray2000

Json Array of zuid - to assign user(if empty task creator will be assigned by default)

dueDateText200

due date of event in "yyyy-MM-dd" format

clearDueDateBoolean-

to remove due date

isCompletedBoolean-

to complete a task (will work in update task alone)

isReopenBoolean-

to reopen a completed task (will work in update task alone)

frequencyNumber-

Allowed values : 0,1,2,3 {0 - Daily ,1 - Weekly, 2 - Monthly, 3 - Yearly}

howOftenRepetitionNumber-

Allowed values 1 to 30

dayOfWeekNumber-

Mandatory for WEEKLY repetition.

Allowed values : 1,2,3,4,5,6,7 {1 - Sunday to 7 - Saturday}

Multiple day for week repetition can be done by comma separated values

dayOfMonthNumber-

Mandatory for MONTHLY and YEARLY repetition

Allowed values 1 to 31. 

monthOfYearNumber-

Used in YEARLY repetition

Allowed values 0 to 11.  0 - January to 11 - December

repeatEndDateText200Repetition End Date in "yyyy-MM-dd" format
clearRepetitionBoolean-To stop repetition
reminderTimeText200Reminder Time in "yyyy-MM-dd HH:mm" format
remindAllBoolean-Whether to remind All and remind current user alone
clearReminderBoolean-To remove reminder
To map a third party entity with connect entity
Key nameData typeMaximum lengthDescription
tpEntityIdText250Third part ID (example - task id from Trello)
tpMetaDetailsJSONObject5000Third part details

 

Example

Consider the below example where the user can post a status to a group using the post type, Scope ID, Partition ID, the message to be posted (message title being optional)

contentMap = {"message":"This is a test message", "title":"This is a test title"}
postDetails = zoho.connect.addPost("status", 105000017039001, 105000207776548, contentMap);

where,

postDetails
is a variable which will hold the returned response
status
is a STRING value that represents the type of the post
105000017039001
is a BIGINT variable that represents the Scope ID of the network
105000207776548
is a BIGINT variable that represents the Partition ID of the group
contentMap
is a MAP variable that represents message content to be posted to the group

Additionally, users can post stuff from third party services. For example, a tweet in twitter can be posted in Connect using a third party message id and metadata of the post content.

This is to facilitate integration and to allow the user to assign a custom ID (different from those of ZOHO Connect posts) for easy identification and retrieval. The syntax remains the same as zoho.connect.addPost(), the only change being in the contentMap with additional (optional) parameters

This third party message can be retrieved using both the Stream ID and the Third Party Entity Id (custom) of the message

Consider below the example where a tweet about the inventory details of a stationery store is being posted in ZOHO Connect

metaDetails = {"Charts":"4", "Books":"10};
contentMap = {"message":"Stock Details of Stationery Store", "title":"Stationery Store", "tpEntityId":"TPEntity001", "tpMetaDetails":metaDetails };
postDetails = zoho.connect.addPost("status", 105000017039001, 105000207776548, contentMap);

where,

metaDetails
is a JSONObject variable that represents the third party message content to be posted
tpEntityId
is a STRING variable that represents the third party ID of the message to be posted
TPEntity001
is a STRING value that represents an alphanumeric, user-defined third party ID of the message to be posted
tpMetaDetails
is a JSON Object variable that represents the third party message content

Sample Response

  • Following is a sample success response:
{"id":"105000209424697",
"status":"success" }
  • To fetch the stream ID, use the following snippet:
info <response_variable>.get("id");
  • The response returned is null when the Scope ID supplied is incorrect
  • The response returned when an incorrect Partition ID is supplied is provided below
{"reason":"Something went wrong. Please try after sometime.",
"status":"failure"}
  • The following error message is encountered when the message content is not supplied in the contentMap required to post a message.
{"reason":"Post content should not be empty.",
"status":"failure"}

Related Links

Get Started Now

Execute