Read content
Reading needs only a valid Connect API key: no write permission is required. Every read is a GET request (see Conventions for pagination and errors). Reads cover your whole community, including the topics (groups in the Dashboard) restricted to some of your members.
Endpoints
Get a list of feed items
Your community content is organized into feeds, each grouping messages in a different way for display. These endpoints return pages of feed items:
| Feed | Endpoint |
|---|---|
| Posts in a topic, sorted by creation date | GET /v1/feeds/posts?topicId= |
| Comments on a post, sorted by creation date | GET /v1/feeds/comments?postId= |
| Replies to a comment, sorted by creation date | GET /v1/feeds/replies?commentId= |
| Posts by a member, sorted by creation date | GET /v1/feeds/user/{octopusId}/posts |
| All posts, sorted by creation date | GET /v1/feeds/posts/all |
For the first four feeds, the following parameters are available:
- The ID of the parent (topic, post, comment or member).
- The
pageSizedefines the number of items per page. It must be between 1 and 20 and defaults to 5. - The sort
order, which can beAscorDesc.Ascreturns items from oldest to newest, whileDescreturns items from newest to oldest. The default isDesc. - The
pageCursoris an opaque cursor returned in the previous response asnextPageCursor. Pass it to get the next page of feed items; leave it blank for your first request. Because the cursor encodes the sort order, anyorderparameter passed alongside it is ignored. includeHidden:truealso returns the hidden content. The default isfalse.
To retrieve all posts, you can use these parameters:
originTime: if you want to start at a specific timestamp. Expected format: a Unix timestamp in milliseconds.order: can beAscorDesc.Ascreturns items from oldest to newest, whileDescreturns items from newest to oldest. The default isDesc.direction: can beBeforeorAfter. If you provide anoriginTime,Afterretrieves all posts more recent than this timestamp, andBeforereturns all posts created before this timestamp. The default isBefore.- The
pageSizedefines the number of posts per page. It must be between 1 and 20 and defaults to 5. - The
pageCursoris an opaque cursor returned in the previous response asnextPageCursor. Pass it to get the next page of posts; leave it blank for your first request. Because the cursor encodes the sort order and direction, anyorderordirectionparameters passed alongside it are ignored. includeHidden:truealso returns the hidden content. The default isfalse.
Your API key reads your whole community: posts, comments and replies in topics restricted to some of your members are returned in full, and GET /v1/messages/topics lists those topics too. Filter this content before you republish it outside the community, for example on a public web page.
Hidden and moderated content
Every post, comment and reply the API returns carries hidden: true when it is hidden from other members' feeds. A message is hidden from the Dashboard, with POST /v1/messages/{id}/hide, or because its author is a hidden member.
- The feeds leave hidden messages out, as the app does. Pass
includeHidden=trueto get them too, each withhidden: true. The cursor does not remember it: pass it on every page. - A hidden message can still be fetched by its Octopus ID through the
messagesendpoints. - The comments, replies and posts embedded by
retrieveLatestComments,retrieveLatestRepliesandretrieveLatestPostsleave hidden messages out: use the matching feed withincludeHidden=trueto list them. childrenCountdoes not count hidden comments or replies.
Once a message is moderated, your API key can no longer read it either:
- Fetching it by id answers
404 Not Found, just like an unknown id. - It is left out of every feed, even with
includeHidden=true, and out of the embedded latest comments and replies. - It no longer counts in its parent's
childrenCount. The count drops a few seconds after the moderation, not instantly.
A hidden message, by contrast, is still returned by id, with hidden: true.
Moderation removes only the message itself, not its thread: the comments and replies under a moderated post stay readable by id, and GET /v1/feeds/comments?postId= still lists them.
Get details of a message item
| Message | Endpoint |
|---|---|
| A post | GET /v1/messages/post?postId= |
| A comment | GET /v1/messages/comment/{commentId} |
| A reply | GET /v1/messages/reply/{replyId} |
With a message ID, you can retrieve the following details about the targeted content:
- Body of the message: text, photo URLs (up to 10 on a post, in the order they show) or a video URL, poll options, call-to-action button.
- Author:
createdBy, with the member'suserId, nickname and avatar. It isnullonce the author is banned. - Metrics: view count, reactions, poll results.
- The five latest answers — only available when the message is a post or comment — if
retrieveLatestCommentsorretrieveLatestRepliesis set totrue. - A cursor to retrieve the next page of answers, when more exist and were requested.
By using the query parameter clientObjectId instead of postId, you can retrieve a bridge post by the client object ID you assigned to it (the same ID passed to the SDK, or to POST /v1/messages/bridge-posts, when the bridge post was created).
All message text is returned in its original language. Use the get translations endpoint to fetch all existing translations.
Get details about a profile
GET /v1/users/profile, with either an octopusId or a loginId (the id of the member in your own system) as a query parameter, returns:
- Octopus ID of the member (
profile.id, theuserIdthe write endpoints take) - Nickname
- Avatar URL
- Biography
- Total number of messages the member has written (all types)
- Account age in days
- Gamification level (if gamification is enabled for your community)
- Five most recent posts (when
retrieveLatestPosts=true)
Other useful endpoints
Get all topics
GET /v1/messages/topics lists all topics of your community with their IDs, names and descriptions. Use it to get the topicId that bridge posts, new posts and scheduled posts need.
Get all translations of a message
GET /v1/messages/translations/{itemId} returns all translations generated for the text parts of a message.
Translations are grouped by language code and provided for the following fields:
- text
- poll options
- call-to-action button
- catchPhrase (for bridge posts)
Example use cases
The responses below are trimmed to the fields each example uses. The API reference lists every field.
Display engagement counters on an article linked to a bridge post
Fetch the bridge post by your own object id, then show its comment count, view count and reactions next to your article:
curl "https://connect.octopuscommunity.com/v1/messages/post?clientObjectId=<CLIENT_OBJECT_ID>&retrieveLatestComments=false" \
--header "Authorization: Bearer $CONNECT_API_KEY"
{
"post": {
"id": "<POST_ID>",
"metrics": {
"childrenCount": 12,
"viewCount": 340,
"reactions": [
{"unicode": "❤️", "count": 8},
{"unicode": "👏", "count": 3}
]
}
}
}
metrics can be null, and reactions is empty while nobody has reacted.
Display posts of a specific topic
List the latest posts of a topic, newest first, with their author and text:
curl "https://connect.octopuscommunity.com/v1/feeds/posts?topicId=<TOPIC_ID>&pageSize=10&order=Desc" \
--header "Authorization: Bearer $CONNECT_API_KEY"
{
"posts": [
{
"id": "<POST_ID>",
"createdAt": 1763458800000,
"createdBy": {"userId": "<USER_ID>", "nickname": "Camille"},
"content": {"text": "Has anyone tried the canelé recipe yet?"}
}
],
"nextPageCursor": "<NEXT_PAGE_CURSOR>"
}
Pass nextPageCursor as pageCursor to get the next ten posts. createdBy is null when the author was banned.
Display a user's latest post
Look a member up by the id they have in your own system, and get their latest posts in the same call:
curl "https://connect.octopuscommunity.com/v1/users/profile?loginId=<YOUR_USER_ID>&retrieveLatestPosts=true" \
--header "Authorization: Bearer $CONNECT_API_KEY"
{
"profile": {"id": "<OCTOPUS_ID>", "nickname": "Camille"},
"firstPostsPage": [
{"id": "<POST_ID>", "content": {"text": "Has anyone tried the canelé recipe yet?"}}
],
"cursor": "<CURSOR>"
}
firstPostsPage holds the member's five latest posts. To page further, pass cursor as pageCursor to GET /v1/feeds/user/{octopusId}/posts.