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

Back to top

URL

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

Back to top

Sample Request

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

Request URL

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

Sample request headers

Accept: application/json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

None.

Back to top

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

Back to top

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.

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.
count Query integer Optional The number of comments to be returned, from the specified starting point. If not specified, all 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.

Back to top

Response

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

Back to top

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: Mon, 22 Jul 2013 22:01:55 GMT

Sample response body

{
  "totalResults" : 3,
  "startIndex" : 0,
  "Comment" : [ {
    "CommentID" : "comment25801.acmepaymentscorp",
    "CommentSubjectID" : "discussion25800.acmepaymentscorp",
    "Content" : "Support for French would be my first choice.",
    "Created" : "2013-07-22T21:52:01Z",
    "Marks" : 3,
    "IsMarked" : true,
    "UserID" : "2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp",
    "UserName" : "PhilipPirrip",
    "AvatarURL" : "http://api.acmepaymentscorp.com/api/users/2d0bc425-49ec-4c04-b272-cc8f6f20e52b.acmepaymentscorp/avatars/ce76ac4e-02db-47a3-a0d4-1f2e66a6cf3e.png"
  }, {
    "CommentID" : "comment25802.acmepaymentscorp",
    "CommentSubjectID" : "discussion25800.acmepaymentscorp",
    "Content" : "Just more of the same; what you have is great but we need more!",
    "Created" : "2013-07-22T21:52:44Z",
    "Marks" : 3,
    "IsMarked" : false,
    "UserID" : "957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp",
    "UserName" : "JonathanSwift",
    "AvatarURL" : "http://api.acmepaymentscorp.com/api/users/957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp/avatars/12d0fdd6-4707-4262-8c88-28ab3b5036c3.png"
  }, {
    "CommentID" : "comment25803.acmepaymentscorp",
    "CommentSubjectID" : "discussion25800.acmepaymentscorp",
    "Content" : "Bug fix: if I don't close out, when the app times out it hangs my device.",
    "Created" : "2013-07-22T21:53:55Z",
    "Marks" : 2,
    "IsMarked" : false,
    "UserID" : "d4e9b5d9-bd93-4c4e-acfd-bcf23527c729.acmepaymentscorp",
    "UserName" : "JenniferMeadows",
    "AvatarURL" : "http://api.acmepaymentscorp.com/api/users/d4e9b5d9-bd93-4c4e-acfd-bcf23527c729.acmepaymentscorp/avatars/54855681-ba54-43f0-bc76-a300c4772b8b.png"
  } ]
}

Back to top

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

Back to top

Response Body

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

Back to top

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.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics