Add a post
Table of Contents
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,
Parameter | Description | Data 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:
| 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 name | Data type | Maximum length | Description |
message* | HTML Text | 25000 | Content to be posted as Status(Supports basic Html tags which are supported in editor) |
title | TEXT | 300 | Title of the status |
linkUrl | TEXT | 500 | Url to be posted as link Info |
To post an event | |||
Key name | Data type | Maximum length | Description |
eventTitle* | Text | 250 | Title of the event |
eventDesc | Text | 1000 | Description of the event |
eventLocation | Text | 250 | Location of the event |
invitedUsers | Text | 2000 | CSV of user email Ids - to invite user |
invitedUserIds | JSONArray | 2000 | Json Array of zuid - to invite user |
invitedGroupIds | JSONArray | 2000 | Json Array of partitionId - to invite group |
startDate* | Text | 100 | Start date of event in "yyyy-MM-dd HH:mm" format |
endDate* | Text | 100 | end date of event in "yyyy-MM-dd HH:mm" format |
allDay | Boolean | - | whether the event is All day or not |
To post a task | |||
Key name | Data type | Maximum length | Description |
taskTitle* **Task can create inside board only | Text | 250 | Title of the task |
taskDesc | Text | 500 | Description of the task |
sectionId | Number | 250 | Id of the section inside a board |
priority | None|Low|Medium|High | - | Priority of the task |
assignedUsers | Text | 2000 | CSV of user email Ids - to assign user(if empty task creator will be assigned by default) |
assignedUserIds | JSONArray | 2000 | Json Array of zuid - to assign user(if empty task creator will be assigned by default) |
dueDate | Text | 200 | due date of event in "yyyy-MM-dd" format |
clearDueDate | Boolean | - | to remove due date |
isCompleted | Boolean | - | to complete a task (will work in update task alone) |
isReopen | Boolean | - | to reopen a completed task (will work in update task alone) |
frequency | Number | - | Allowed values : 0,1,2,3 {0 - Daily ,1 - Weekly, 2 - Monthly, 3 - Yearly} |
howOftenRepetition | Number | - | Allowed values 1 to 30 |
dayOfWeek | Number | - | 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 |
dayOfMonth | Number | - | Mandatory for MONTHLY and YEARLY repetition Allowed values 1 to 31. |
monthOfYear | Number | - | Used in YEARLY repetition Allowed values 0 to 11. 0 - January to 11 - December |
repeatEndDate | Text | 200 | Repetition End Date in "yyyy-MM-dd" format |
clearRepetition | Boolean | - | To stop repetition |
reminderTime | Text | 200 | Reminder Time in "yyyy-MM-dd HH:mm" format |
remindAll | Boolean | - | Whether to remind All and remind current user alone |
clearReminder | Boolean | - | To remove reminder |
To map a third party entity with connect entity | |||
Key name | Data type | Maximum length | Description |
tpEntityId | Text | 250 | Third part ID (example - task id from Trello) |
tpMetaDetails | JSONObject | 5000 | Third 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
status
105000017039001
105000207776548
contentMap
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
tpEntityId
TPEntity001
tpMetaDetails
Sample Response
- Following is a sample success response:
"status":"success" }
- To fetch the stream ID, use the following snippet:
- 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
"status":"failure"}
- The following error message is encountered when the message content is not supplied in the contentMap required to post a message.
"status":"failure"}