Skip to main content

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:

FeedEndpoint
Posts in a topic, sorted by creation dateGET /v1/feeds/posts?topicId=
Comments on a post, sorted by creation dateGET /v1/feeds/comments?postId=
Replies to a comment, sorted by creation dateGET /v1/feeds/replies?commentId=
Posts by a member, sorted by creation dateGET /v1/feeds/user/{octopusId}/posts
All posts, sorted by creation dateGET /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 pageSize defines the number of items per page. It must be between 1 and 20 and defaults to 5.
  • The sort order, which can be Asc or Desc. Asc returns items from oldest to newest, while Desc returns items from newest to oldest. The default is Desc.
  • The pageCursor is an opaque cursor returned in the previous response as nextPageCursor. Pass it to get the next page of feed items; leave it blank for your first request. Because the cursor encodes the sort order, any order parameter passed alongside it is ignored.
  • includeHidden: true also returns the hidden content. The default is false.

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 be Asc or Desc. Asc returns items from oldest to newest, while Desc returns items from newest to oldest. The default is Desc.
  • direction: can be Before or After. If you provide an originTime, After retrieves all posts more recent than this timestamp, and Before returns all posts created before this timestamp. The default is Before.
  • The pageSize defines the number of posts per page. It must be between 1 and 20 and defaults to 5.
  • The pageCursor is an opaque cursor returned in the previous response as nextPageCursor. 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, any order or direction parameters passed alongside it are ignored.
  • includeHidden: true also returns the hidden content. The default is false.
warning

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=true to get them too, each with hidden: 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 messages endpoints.
  • The comments, replies and posts embedded by retrieveLatestComments, retrieveLatestReplies and retrieveLatestPosts leave hidden messages out: use the matching feed with includeHidden=true to list them.
  • childrenCount does 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​

MessageEndpoint
A postGET /v1/messages/post?postId=
A commentGET /v1/messages/comment/{commentId}
A replyGET /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's userId, nickname and avatar. It is null once 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 retrieveLatestComments or retrieveLatestReplies is set to true.
  • A cursor to retrieve the next page of answers, when more exist and were requested.
tip

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).

note

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, the userId the 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.