GET /api/discussions/{DiscussionID}/comments

Returns the comments associated with a specified discussion.

Authorization Roles/Permissions: This operation applies to all users.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/discussions/{DiscussionID}/comments[?userID={UserID}][&start={start}][&count={count}]

Sample Request

The example below shows a request for the comments on the specified discussion.

Request URL #1

Returns all comments for the specified discussion.

https://{hostname}/api/discussions/discussion25800.acmepaymentscorp

Request URL #2

Returns the 5 most recent comments for the specified discussion.

https://{hostname}/api/discussions/discussion584195.acmepaymentscorp/comments?start=0&count=5

Sample request headers

Accept: application/json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

None.

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
DiscussionID Path string Required The unique ID for a specific discussion.
UserID Query string Required

The unique ID for a specific user.

ID of the user retrieving the comment.

IncludeCommentActions Query boolean Optional Indicates whether workflow actions currently valid for a comment on the board should be included in the results. Default: false. For valid workflow actions for comments, see Comments: Valid Workflow Actions.
start Query integer Optional

The starting point for the comments to be returned, with 0 as the first comment. For example, if there are 73 comments and the start value is 50, comment number 50 is the first to be returned.

Note: The comments are counted from the most recent, backwards in time. The most recent comment is the starting point.

count Query integer Optional

The number of comments to be returned, from the specified starting point. If not specified, 100 comments associated with the specified discussion are returned. For example, if there are 105 comments and start is 50 with count 50, comments 50-100 are returned.

If a value is specified for count but the start parameter is omitted, the specified number of comments are returned. For example, if count is specified as 5, the 5 most recent comments are returned.

Response

If successful, this operation returns HTTP status code 200, with the discussion comments in the form of a JSON object.

Sample Response

The sample response below shows successful completion of this operation. Three results were returned.

Sample response headers

Status Code: 200 OK
Content-Type: application/json
Date: Thu, 12 Mar 2020 20:32:06 GMT

Sample response body

{
  "totalResults": 3,
  "startIndex": 0,
  "Comment": [
    {
      "CommentID": "a19dc1c2-3be3-4709-9cec-087666d571c4.acmepaymentscorp",
      "CommentSubjectID": "discussion584195.acmepaymentscorp",
      "Content": "Just more of the same; what you have is great but we need more!",
      "Created": "2020-03-12T20:30:20Z",
      "Marks": 1,
      "IsMarked": true,
      "UserID": "5dbe0d90-eb62-454e-a1fd-23ba5abfbfbc.acmepaymentscorp",
      "UserName": "JonathanSwift",
      "AvatarURL": "https://acmepaymentscorp.apiportal.akana.com:443/api/users/5dbe0d90-eb62-454e-a1fd-23ba5abfbfbc.acmepaymentscorp/avatars/cf5141bb-b6e5-42ed-b2c0-673179cb414a.png",
      "Published": true,
      "MediaType": "text/markdown",
      "BoardItemArtifacts": {
        "BoardItemArtifact": []
      }
    },
    {
      "CommentID": "05d62744-1232-464f-b1f1-f33440c7b058.acmepaymentscorp",
      "CommentSubjectID": "discussion584195.acmepaymentscorp",
      "Content": "Bug fix: if I don't close out, when the app times out it hangs my device.",
      "Created": "2020-03-12T20:27:37Z",
      "Marks": 2,
      "IsMarked": true,
      "UserID": "31af17ef-38e5-4dc2-9b50-92dad8aa7fa7.acmepaymentscorp",
      "UserName": "PhilipPirrip",
      "AvatarURL": "https://acmepaymentscorp.apiportal.akana.com:443/api/users/31af17ef-38e5-4dc2-9b50-92dad8aa7fa7.acmepaymentscorp/avatars/9e9ca10e-56f5-43f9-a2f4-f268a7dd0b69.png",
      "Published": true,
      "MediaType": "text/markdown",
      "BoardItemArtifacts": {
        "BoardItemArtifact": []
      }
    },
    {
      "CommentID": "d7f802bf-395b-40a7-a1fb-a9169921e4ea.acmepaymentscorp",
      "CommentSubjectID": "discussion584195.acmepaymentscorp",
      "Content": "\"Support for French would be my first choice.",
      "Created": "2020-03-12T20:26:58Z",
      "Marks": 2,
      "IsMarked": true,
      "UserID": "f1ee5aaa-e58e-4bc7-989e-490ccd854904.acmepaymentscorp",
      "UserName": "JenMead",
      "AvatarURL": "https://acmepaymentscorp.apiportal.akana.com:443/api/users/f1ee5aaa-e58e-4bc7-989e-490ccd854904.acmepaymentscorp/avatars/7057fa39-e78d-4055-bbb0-3afa21532f51.png",
      "Published": true,
      "MediaType": "text/markdown",
      "BoardItemArtifacts": {
        "BoardItemArtifact": []
      }
    }
  ]
}

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json

Response Body

Name Type Description
Comments Comments Contains information about one or more comments on a Board item.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
204 No content. You would get this response if there are no comments on the specified ticket.
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.