Get a post
Table of Contents
Note:
- Each time the zoho.connect.getPost integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.connect.getPost integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
This task is used to fetch the contents of a specified post.
Syntax
<variable> = zoho.connect.getPost(<scopeID>, <streamID>, <connectionName>);
where,
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | is the variable which will hold the returned response. The response will contain group names and group IDs under a particular network |
| <scopeID> | NUMBER | is the variable that represents the Scope ID of the network where the post exists. You can also fetch the scope ID from the response of myNetworks task. |
| <streamID> | NUMBER | is the variable that represents the Stream ID of the post. You can fetch the stream ID from the response of addPost task. |
| <connectionName> | TEXT | is the name of the Zoho connect connection. Note:
|
Example
The contents of a post with Stream ID 105000209401145 is fetched in the example below.
postDetails = zoho.connect.getPost(105000017039001, 105000209401145);
where,
postDetailsis a variable that holds the message content and the related details of the post
105000017039001is a value that represents the Scope ID of the network
105000209401145is a value that represents the Stream ID of the post
Sample Response
- Following is a response when the post details are retrieved.
{"post":
{"partitionId":"105000207776548",
"plainContent":"Tomorrow will be a holiday",
"networkName":"Trading Corporation",
"richContent":"Tomorrow will be a holiday",
"isPrivate":"false",
"title":"Announcement",
"partitionType":"2",
"url":"https://connect.zoho.com/portal/intranet/stream/105000209401145",
"partitionName":"Test Group",
"createdBy":{"profileUrl":"https://connect.zoho.com/portal/intranet/profile/12345",
"isBot":"false",
"isGuest":"false",
"imageUrl":"https://contacts.zoho.com/file?t=user&ID=12345&fs=thumb",
"name":"Test User",
"timeZone":"Asia/Kolkata",
"language":"en",
"emailId":"testuser@zohocorp.com",
"id":"12345"},
"createdTime":"2018-05-03T10:20+0000",
"attachmentCount":"0",
"networkId":"105000017039001",
"id":"105000209401145"},
"status":"success"}
{"partitionId":"105000207776548",
"plainContent":"Tomorrow will be a holiday",
"networkName":"Trading Corporation",
"richContent":"Tomorrow will be a holiday",
"isPrivate":"false",
"title":"Announcement",
"partitionType":"2",
"url":"https://connect.zoho.com/portal/intranet/stream/105000209401145",
"partitionName":"Test Group",
"createdBy":{"profileUrl":"https://connect.zoho.com/portal/intranet/profile/12345",
"isBot":"false",
"isGuest":"false",
"imageUrl":"https://contacts.zoho.com/file?t=user&ID=12345&fs=thumb",
"name":"Test User",
"timeZone":"Asia/Kolkata",
"language":"en",
"emailId":"testuser@zohocorp.com",
"id":"12345"},
"createdTime":"2018-05-03T10:20+0000",
"attachmentCount":"0",
"networkId":"105000017039001",
"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"}
"status":"failure"}