> For the complete documentation index, see [llms.txt](https://docs.opshub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opshub.com/v7.206/connector-sdk-index/sdk-connector-apis/get-comments.md).

# Get Comments

### Overview

Return existing comments for the given entity ID.

### API URI

```bash
GET: /entities/{entityTypeId}/{entityId}/comments?projectId={projectId}&startIndex=<startIndex>&maxResults=<maxResults>&nextPageLink=<nextPageLink>&afterTime=<afterTime>
```

### URI Parameters

| **Name**     | **In** | **Required** | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------ | ------ | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| entityTypeId | path   | True         | String   | `id` of entity type for given entityId                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| entityId     | path   | True         | String   | `id` of entity for which comments need to be returned                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| projectId    | query  | True         | String   | Project in which the given entity exists                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| startIndex   | query  | True         | Integer  | Start index from which comments need to be returned                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| maxResults   | query  | True         | Integer  | Number of comments from `startIndex` that need to be returned                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| nextPageLink | query  | False        | String   | Link to the next page if returned by the end system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| afterTime    | query  | False        | String   | <p>Time after which the comments are to be filtered.<br><br>The <code>afterTime</code> date format will be the same as provided in <a href="/v7.206/connector-sdk-index/sdk-connector-apis/entity-type-get.md#response-payload"><code>comments.createUpdateDateFormat</code> in response payload for Entity Type – Get API</a>, and <code>timeZone</code> will be the same as provided in <a href="/v7.206/connector-sdk-index/sdk-connector-apis/server-info.md#response-payload"><code>timeZone</code> in response payload for Server-Info API</a>.<br><br>- If the end system API does not support time-based filtering on comments, this parameter may be ignored.<br>- If the end system API supports time-based filtering on comments, the connector should return the comments with a createdUpdatedTime greater than the specified afterTime.<br>- If “null” is passed in the “afterTime” then connector needs to return all the comments without any time filter applied.</p> |

### Response Payload

```json
{
  "nextPageLink": "// Link to the next page if returned by the end system",
  "nextPageLinkSupported": "true/false | datatype: boolean",
  "comments": [
    {
      "<idField>": "",
      "<titleField>": "",
      "<bodyField>": "",
      "<createdByField>": "",
      "<createdDateField>": "",
      "<updatedByField>": "",
      "<updatedDateField>": "",
      "<commentTypeField>": ""
    }
  ]
}
```

> **Note**": The key names in the above JSON will be as per the comment field names in your connector.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opshub.com/v7.206/connector-sdk-index/sdk-connector-apis/get-comments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
