Update a post
Table of Contents
Overview
This task is used to update a post added using the addPost task.
Syntax
<variable> = zoho.connect.updatePost(<scopeID>, <streamID>, <contentMap>, <connectionName>);
where,
Parameter | Description | Data type |
<variable> | is the variable which will hold the returned response. The response will contain the Stream ID of the post and the status of the update request. | KEY-VALUE |
<scopeID> | is the variable that represents the Scope ID of the network in which the post to be updated exists. You can also fetch the scope ID from the response of myNetworks task. | NUMBER |
<streamID> | is the variable that represents the Stream ID of the message to be updated. You can fetch the stream ID from the response of addPost task. | NUMBER |
<contentMap> | is the variable which contains key value pairs to update the post. All keys listed in the addPost task are applicable here. Apart from the above, applicable boolean keys are:
The values for these keys can be either true or false. | 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 |
Example
Imagine that a post needs to be updated due to a typo error or due to a change required in the content. This can be achieved using the Scope ID of the network, Stream ID of the post and the message content to be updated, like below.
contentMap = {"message":"This message is being updated"} postDetails = zoho.connect.updatePost(105000017039001, 105000209401145, contentMap);
where,
postDetails
105000017039001
105000209401145
contentMap
Sample Response
- The following is a sample success response:{"id":"105000209401145",
"status":"success"} - The response returned is null when the Scope ID supplied is incorrect.
- The response returned when an incorrect Stream ID is supplied, is provided below{"reason":"This post has been deleted.",
"status":"failure"}