GET api/v2.0/Comments/GetComments?afterCommentKey={afterCommentKey}&beforeCommentKey={beforeCommentKey}&limit={limit}

This will retrieve a paginated set of comments based on the commentKey provided. Using the afterCommentKey is recommended when continuing the default order of comments provided by the Get endpoint or other various endpoints. Either the afterCommentKey or the beforeCommentKey must be provided. If both keys are put in the request, the afterAnswerKey will take precedence.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
afterCommentKey

The unique identifier for the comment that you would like to use as a starting point to retrieve comments, the result will not include this comment.

globally unique identifier

None.

beforeCommentKey

The unique identifier for the comment that you would like to use as a starting point to retrieve comments prior to the specified comment, the result will not include this comment.

globally unique identifier

None.

limit

The number of comments to return. Default is 10, max is 50.

integer

Default value is 10

Body Parameters

None.

Response Information

Resource Description

The set of comments will always return in order starting with the official comment (if one exists), then by most recent to least recent. Using the afterCommentKey will return a specified number of comments after the specified comment, beforeCommentKey will return a specified number of comments before the comment in that sort order

PaginatedComments
NameDescriptionTypeAdditional information
Comments

The set of paginated comments

Collection of Comment

None.

HasMoreComments

Whether or not additional comments exist after the last comment in the set

boolean

None.

Next

a relative path to retrieve the next set of comments if additional comments exist

string

None.

Previous

a relative path to retrieve the previous set of comments if previous comments exist

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Comments": [
    {
      "CommentKey": "9b37958d-e9e0-4e29-b415-0c2d4070c801",
      "CommentBody": "sample string 2",
      "CommentAuthor": {
        "LinkToProfile": "sample string 1",
        "PictureUrl": "sample string 2",
        "ContactKey": "c7e3e631-0921-4aa4-9381-38bfdb0e7aa3",
        "FirstName": "sample string 4",
        "LastName": "sample string 5",
        "DisplayName": "sample string 6",
        "EmailAddress": "sample string 7",
        "ContactStatusCode": "sample string 8",
        "PrefixCode": "sample string 9",
        "UpdatedOn": "2021-05-13T03:08:25.1281289Z",
        "UpdatedByContactKey": "74881d6e-dde9-4be5-a988-4e76ad4c9cfe",
        "CompanyName": "sample string 12",
        "CompanyTitle": "sample string 13",
        "SuffixCode": "sample string 14",
        "Designation": "sample string 15",
        "LegacyContactKey": "sample string 16",
        "InformalName": "sample string 17",
        "MiddleName": "sample string 18",
        "IsCompany": true,
        "CompanyLegacyContactKey": "sample string 20",
        "AMSDirectoryOptOut": true,
        "HLDirectoryOptOut": true,
        "HLContactMeOptOut": true,
        "LargePictureUrl": "sample string 24",
        "AgreedToTermsDateTime": "2021-05-13T03:08:25.1281289Z"
      },
      "IsOfficial": true,
      "CreatedOn": "2021-05-13T03:08:25.1281289Z",
      "UpdatedOn": "2021-05-13T03:08:25.1281289Z"
    },
    {
      "CommentKey": "9b37958d-e9e0-4e29-b415-0c2d4070c801",
      "CommentBody": "sample string 2",
      "CommentAuthor": {
        "LinkToProfile": "sample string 1",
        "PictureUrl": "sample string 2",
        "ContactKey": "c7e3e631-0921-4aa4-9381-38bfdb0e7aa3",
        "FirstName": "sample string 4",
        "LastName": "sample string 5",
        "DisplayName": "sample string 6",
        "EmailAddress": "sample string 7",
        "ContactStatusCode": "sample string 8",
        "PrefixCode": "sample string 9",
        "UpdatedOn": "2021-05-13T03:08:25.1281289Z",
        "UpdatedByContactKey": "74881d6e-dde9-4be5-a988-4e76ad4c9cfe",
        "CompanyName": "sample string 12",
        "CompanyTitle": "sample string 13",
        "SuffixCode": "sample string 14",
        "Designation": "sample string 15",
        "LegacyContactKey": "sample string 16",
        "InformalName": "sample string 17",
        "MiddleName": "sample string 18",
        "IsCompany": true,
        "CompanyLegacyContactKey": "sample string 20",
        "AMSDirectoryOptOut": true,
        "HLDirectoryOptOut": true,
        "HLContactMeOptOut": true,
        "LargePictureUrl": "sample string 24",
        "AgreedToTermsDateTime": "2021-05-13T03:08:25.1281289Z"
      },
      "IsOfficial": true,
      "CreatedOn": "2021-05-13T03:08:25.1281289Z",
      "UpdatedOn": "2021-05-13T03:08:25.1281289Z"
    }
  ],
  "HasMoreComments": true,
  "Next": "sample string 2",
  "Previous": "sample string 3"
}

application/xml, text/xml

Sample:
<PaginatedComments xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/HigherLogic.API.Models.Enterprise.Comments" />