Retrieve a List of Comments Posted to an Answer

You can use this API request to get a list of comments posted to a specific answer.

/services/v2/answer/[answerId]/comment.json

You can use the following parameters in your retrieve a list of comments posted to an answer request:

Other options: wrap, v1

🚧

Permissions & Notes:

  • You must have the View answers in the question page and "View the question page" permissions under Anonymous Roles under the Advanced Editor.

  • We added this request in version 1.6.3.

Sample Request

A GET retrieve a list of comments posted to an answer to retrieve a list of comments posted to an answer (answerId: 799) sent to https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub/test123) would look like this:

curl 
-u answerhub:test123 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X GET "https://apidocs.cloud.answerhub.com/services/v2/answer/799/comment.json" -v

Sample Response

{
  "name": "",
  "sort": "active",
  "page": 1,
  "pageSize": 15,
  "pageCount": 1,
  "listCount": 2,
  "totalCount": 2,
  "sorts": [
    "active",
    "newest",
    "hottest",
    "votes",
    "viewCount",
    "usedCount",
    "answerCount",
    "answerCountAsc",
    "commentCount",
    "favoriteCount",
    "followers",
    "reportCount"
  ],
  "list": [
    {
      "id": 4479,
      "type": "comment",
      "creationDate": 1472849852000,
      "creationDateFormatted": "09/02/2016 08:57 PM",
      "body": "Test Comment 2\n",
      "bodyAsHTML": "<p>Test Comment 2<br></p>\n",
      "author": {
        "id": 2531,
        "username": "testUser",
        "reputation": 172
      },
      "lastEditedAction": 23561,
      "activeRevisionId": 5880,
      "revisionIds": [
        5880
      ],
      "lastActiveUserId": 2531,
      "lastActiveDate": 1472849852000,
      "originalParentId": 4476,
      "attachments": [],
      "childrenIds": [],
      "commentIds": [],
      "marked": false,
      "topics": [],
      "containerIds": [],
      "wiki": false,
      "score": 0,
      "depth": 0,
      "viewCount": 0,
      "upVoteCount": 0,
      "downVoteCount": 0,
      "nodeStates": []
    },
    {
      "id": 4478,
      "type": "comment",
      "creationDate": 1472849845000,
      "creationDateFormatted": "09/02/2016 08:57 PM",
      "body": "Test Comment 1\n",
      "bodyAsHTML": "<p>Test Comment 1<br></p>\n",
      "author": {
        "id": 2531,
        "username": "testUser",
        "reputation": 172
      },
      "lastEditedAction": 23560,
      "activeRevisionId": 5879,
      "revisionIds": [
        5879
      ],
      "lastActiveUserId": 2531,
      "lastActiveDate": 1472849845000,
      "originalParentId": 4476,
      "attachments": [],
      "childrenIds": [],
      "commentIds": [],
      "marked": false,
      "topics": [],
      "containerIds": [],
      "wiki": false,
      "score": 0,
      "depth": 0,
      "viewCount": 0,
      "upVoteCount": 0,
      "downVoteCount": 0,
      "nodeStates": []
    }
  ]
}
Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!