Skip to API content
TalkLabs API Docs v3
Recipes
GET Comments

List Comments

GETTING THE RIGHT COMMENTS If you use ListComments you will get the top level comments.

GET /api/v3/{appid}/comment/conversations/{conversationid}/comments

GETTING THE RIGHT COMMENTS

  • If you use ListComments you will get the top level comments.

  • If you use List Replies you will get comments that are children of another comment.

  • If you want all replies lower in the tree of comments than the current level use the includechildren property.

READ THIS: Cursoring Limitations for Offset Cursors

If you use a cursoring method that is offset based (likes/votescore/mostreplies) rather than time based (oldest/newest) you are not guaranteed to see all of the comments. This is because the original query runs, and returs the comments ordered by your query. But, if you then send another request with a cursor value to get the next bunch, the cursor skips over the first set of results equal to the limit size in the query and returns the next set. So if you change your limit size or the underlying data changes because people react, vote, and like things, then you may not get a perfect results set. It is recommended that you request the top N records in one shot, as long as the request isn't too large. Otherwise, use cursoring with oldest sort method to download the entire list of comments and sort it yourself.

Cursoring

  • API Method returns a cursor

  • Cursor includes a "more" field indicating if there are more results that can be read at the time this call is made

  • Cursor includes "cursor" field, which can be passed into subsequent calls to this method to get additionaal results

  • Cursor includes "itemcount" field, which is the number of items returned by the cursor not the total number of items in the database

  • All LIST methods in the API return cursors and they all work the same way

URL Arguments

  • comment_conversation_id : (required) The ID of the comment conversation, URL ENCODED.

URL Parameters

  • cursor : (optional) If provided, will get the next bundle of comments in the conversation resuming from where the cursor left off.

  • limit : (Optional, default = 200). For cursoring, limit the number of responses for this request.

  • direction: (optional) Default is forward. Must be forward or backward

  • sort : (optional, defaults to "oldest") Specifies that sort should be done by...

    • oldest : Sort by when added ascending (oldest on top)

    • newest : Sort by when added ascending (newest on top)

    • likes : Sort by number of likes, descending (most liked on top)

    • votescore : Sort by net of adding upvotes and subtracting downvotes, descending

    • mostreplies : Sort by number of replies,descending

  • includechildren : (optional, default is false) If false, this returns all reply nodes that are immediate children of the provided parent id. If true, it includes all replies under the parent id and all the children of those replies and so on.

  • includeinactive: (optional, default is false) If false, this returns all reply nodes that are immediate children of the provided parent id. If true, it includes all replies under the parent id and all the children of those replies and so on.

  • filterpostedbyuserid: (optional) If provided, the list returned will be filtered to only include comments published by the specified userid.

Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The TalkLabs application ID assigned to your account.

Example: your-app-id
conversationid path
string TalkLabs ID required

The TalkLabs assigned conversation ID.

Example: conversation-id
sort query
string
Example: oldest
cursor query
string

The cursor returned by the previous page.

limit query
integer · int32

The maximum number of records to return.

Example: 200
direction query
string
Example: forward
includechildren query
boolean
Example: false
includeinactive query
boolean
Example: false
filterPostedByUserId query
string customer-defined
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
404 Not Found ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "Success",
  "errors": {},
  "data": {
    "kind": "list.comments",
    "cursor": "",
    "more": false,
    "conversation": {
      "kind": "comment.conversation",
      "appid": "5e9389ed38a2b10794e271ee",
      "owneruserid": "",
      "conversationid": "my_conversation_id",
      "property": "sportstalk247.com/apidemo",
      "moderation": "post",
      "maxreports": 0,
      "enableprofanityfilter": true,
      "title": "Sample Conversation",
      "maxcommentlen": 512,
      "commentcount": 5,
      "open": true,
      "added": 1587438915,
      "whenmodified": 1587438915,
      "customtype": "",
      "customid": "/articles/2020-03-01/article1/something-very-important-happened",
      "customtags": [
        "taga",
        "tagb"
      ],
      "custompayload": "{ num : 0 }",
      "customfield1": "/sample/userdefined1/emojis/😂🤣❤😍😒",
      "customfield2": "/sample/userdefined2/intl/characters/äöüÄÖÜß"
    },
    "comments": []
  }
}
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.