List Replies
This method works the same way as the List Comments method, so view the documentation on that method.
This method works the same way as the List Comments method, so view the documentation on that method. The difference is that this method will filter to only include comments that have a parent.
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 - ABOUT CURSORING WITH OFFSET CURSORS
The maximum limit value for the request depends on your account. In general, its best to use a lower limit and make multiple calls as users scroll through your application for fastest performance. However for exporting data or reporting purposes, a larger number with fewer requests is better.
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.
ABOUT 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 true, return comments that are inactive (for example, disabled by moderation)
filterpostedbyuserid: (optional) If provided, the list returned will be filtered to only include comments published by the specified userid.
Parameters
Values in the path and query string.
appid path The TalkLabs application ID assigned to your account.
Example:your-app-id conversationid path The TalkLabs assigned conversation ID.
Example:conversation-id commentid path The TalkLabs assigned comment ID.
Example:comment-id sort query oldest cursor query The cursor returned by the previous page.
limit query The maximum number of records to return.
Example:200 direction query forward includechildren query false includeinactive query false filterpostedbyuserid query 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 {
"message": "Success",
"errors": {},
"data": {
"kind": "list.comments",
"cursor": "637273279749919172",
"more": false,
"itemcount": 1,
"conversation": {
"kind": "comment.conversation",
"appid": "5ededa7086c2920e6ccc06f8",
"owneruserid": "",
"conversationid": "demo-conversation-id",
"property": "sportstalk247.com/apidemo",
"moderation": "post",
"maxreports": 0,
"enableprofanityfilter": true,
"title": "Sample Conversation",
"maxcommentlen": 512,
"commentcount": 2,
"open": true,
"added": "2020-06-09T19:32:28.6308249Z",
"whenmodified": "2020-06-09T19:32:28.6308249Z",
"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": [
{
"kind": "comment.comment",
"id": "5edfe3e686c2921148f12902",
"appid": "5ededa7086c2920e6ccc06f8",
"conversationid": "demo-conversation-id",
"commenttype": "comment",
"added": "2020-06-09T19:32:54.9919172Z",
"modified": "2020-06-09T19:32:54.9919172Z",
"userid": "u-8842",
"user": {
"kind": "app.user",
"userid": "u-8842",
"handle": "dave_m",
"handlelowercase": "georgew",
"displayname": "Dave M.",
"pictureurl": "https://example.com/users/u-8842s/photos/original/a9/c7/a6/44-1-george-washington-18-1549729902.jpg",
"profileurl": "https://example.com/users/u-8842shington",
"banned": false
},
"body": "This is a reply.",
"originalbody": "",
"hashtags": [],
"customtype": "",
"customid": "",
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": "",
"edited": false,
"censored": false,
"deleted": false,
"parentid": "5edfe3da86c2921148f12901",
"hierarchy": [
"5edfe3da86c2921148f12901"
],
"mentions": [],
"reactions": [],
"likecount": 0,
"replycount": 0,
"votecount": 0,
"votescore": 0,
"votes": [],
"moderation": "na",
"active": true,
"reports": []
}
]
}
}