Get Comment

Endpoint

URL: /:projectId/comments/:commentId

Method: GET

Authentication Required: No


Description

Fetches a single comment by its ID. Optionally returns the parent comment if it exists and withParent=true is passed.


Request

Path Parameters

ParameterTypeRequiredDescription
commentIdstringYesThe ID of the comment to fetch.

Query Parameters

ParameterTypeRequiredDescription
withParentstringNoIf true, includes the parent comment.

Response

Success Response (200 OK)

Returns the requested comment and optionally its parent:

{
  "comment": {
    "id": "comment-123",
    "entityId": "entity-456",
    "content": "Nice article!",
    ...
  },
  "parentComment": {
    "id": "comment-001",
    "content": "Original post",
    ...
  }
}

If there is no parent or withParent is not provided:

{
  "comment": { ... },
  "parentComment": null
}

Error Responses

Missing or Invalid ID (400 Bad Request)

{
  "error": "Missing a valid comment ID in request query",
  "code": "comment/invalid-request"
}

Not Found (404 Not Found)

{
  "error": "Comment not found",
  "code": "comment/not-found"
}

Server Error (500 Internal Server Error)

{
  "error": "Internal server error.",
  "code": "comment/server-error",
  "details": "[error message]"
}

Notes

  • Set withParent=true to retrieve the parent comment if it exists.
  • Returns parentComment: null if the comment has no parent or withParent is not set.