Get a post
Table of Contents
Overview
This task is used to fetch the contents of a specified post.
Syntax
<variable> = zoho.connect.getPost(<scopeID>, <streamID>, <connectionName>);
where,
Parameter | Description | Data type |
<variable> | is the variable which will hold the returned response. The response will contain group names and group IDs under a particular network | KEY-VALUE |
<scopeID> | 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. | NUMBER |
<streamID> | is the variable that represents the Stream ID of the post. You can fetch the stream ID from the response of addPost task. | NUMBER |
<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
The contents of a post with Stream ID 105000209401145 is fetched in the example below.
postDetails = zoho.connect.getPost(105000017039001, 105000209401145);
where,
postDetails
is a variable that holds the message content and the related details of the post
105000017039001
is a value that represents the Scope ID of the network
105000209401145
is 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"}