Skip to main content

Get All Comments

This endpoint retrieves all comments.

info

If the discussion parameter is specified the endpoint retrieves all comments of a specific Discussion.

If the post parameter is specified the endpoint retrieves all comments of a specific Post.

If the status parameter is specified the endpoint retrieves all comments of a specific Status.

If the user parameter is specified the endpoint retrieves all comments of a specific User.

The discussion, post, status and user parameters cannot be used together and one of these parameters is mandatory.

If the parent parameter is specified (only with discussion, post or status) the endpoint retrieves all comments of a specific Discussion , Post or Status that has the passed parent (nested comments).

info

It is possible to perform multiple ordering by concatenating the params -connection and -added_at.

info

This operation requires authentication only if content_availability community option is false

HTTP Request

GET /api/v2/comment/

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseNumber of results to return per page.
offsetqueryintegerfalseThe initial index from which to return the results.
discussionquerystringtrueId of the Discussion, required if both post, status and user parameters are not set
postquerystringtrueId of the Post, required if both discussion, status and user parameters are not set
statusquerystringtrueId of the Status, required if both discussion, post and user parameters are not set
userquerystringtrueId of the User, required if both discussion, post and status parameters are not set
parentquerystringfalseId of the parent Comment, used for retrieve nested comments
orderingquerystringfalseThe field for sorting use - for order desc. Default to added_at

Enumerated Values

ParameterValueDescription
» orderingadded_atOrder by added_at comment field
» orderingconnectionOrder giving pripority to user connections (friends or followers)

Example Request

const headers = {
'Accept':'application/json',
'Authorization: 'Bearer {access_token}'
};

fetch('/api/v2/comment/',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» countintegerfalsenonenone
» nextstring(uri)¦nullfalsenonenone
» previousstring(uri)¦nullfalsenonenone
» resultslist(Comment)falsenonenone

Example responses


{
"count": "integer",
"next": "string(uri)",
"previous": "string(uri)",
"results": [
{
"id": "integer",
"author": {User},
"added_at": "string",
"last_edited_at": "string",
"html": "string",
"summary": "string",
"deleted": "boolean",
"collapsed": "boolean",
"parent": "integer",
"in_reply_to": "integer",
"comment_count": "integer",
"vote_count": "integer",
"reactions_count": [{Reaction}],
"flag_count": "integer",
"post": {
"id": "integer",
"slug": "string"
},
"latest_comments": [{Comment}],
"type": "string",
"voted": "boolean",
"reaction": {Reaction}
}
]
}