POST/api/v1/posts/comment| Name | Type | Required | Description |
|---|---|---|---|
| x-api-key | String | ✅ Yes | Secret API key provided by Networked. Required for all API calls. |
| Name | Type | Required | Description |
|---|---|---|---|
| comment | String | ✅ Yes | The actual comment in text. |
| postId | String | ✅ Yes | The ID of the post being commented on. |
{
"comment": "test comment 2",
"postId": "6855529c78bddf001282dd01"
}
{
"data": {
"commentId": "6858c0a078bddf001282e06d",
"childCommentscount": 0,
"comment": "<p class='preserveHtml' class='preserveHtml'>test comment 2</p>",
"parentCommentId": null,
"likesCount": 0,
"selfLike": false,
"shareCount": 0,
"user": {
"id": "6787893423126f0012a92ed6",
"name": "Spencer Johnson Spencer",
"image": "https://ntwc-us-east-2-qa-eks-s3-files-storage.s3.us-east-2.amazonaws.com/user-6787893423126f0012a92ed6/file_1741258763688_image (25).png",
"title": " Software Development Test Engineer WBC Community Test Engineer"
}
},
"error": false,
"message": "Post comment created"
}
| Field | Type | Description |
|---|---|---|
| commentId | String | Unique identifier for the newly created comment. |
| childCommentscount | Number | Number of replies (child comments) to this comment. |
| comment | String | HTML-formatted content of the comment. |
| parentCommentId | String | Parent comment id |
| likesCount | Number | Total number of likes received on the comment. |
| selfLike | Boolean | Indicates whether the comment is liked by the current user. |
| shareCount | Number | Number of times the comment has been shared. |
| user | Object | Metadata about the commenter. |
user Object| Field | Type | Description |
|---|---|---|
| id | String | User ID of the commenter. |
| name | String | Name of the commenter. |
| image | String | URL to profile image. |
| title | String | Professional title or designation. |
comment if rendering in frontend.selfLike to determine if the current user has liked the comment.curl --location 'https://backend.networked.co/api/v1/posts/comment' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"comment":"test comment 3","postId":"6855529c78bddf001282dd01"}'{
"data": {
"commentId": "6858c0a078bddf001282e06d",
"childCommentscount": 0,
"comment": "<p>test comment 2</p>",
"parentCommentId": null,
"likesCount": 0,
"selfLike": false,
"shareCount": 0,
"user": {
"id": "6787893423126f0012a92ed6",
"name": "Spencer Johnson Spencer",
"image": "https://ntwc-us-east-2-qa-eks-s3-files-storage.s3.us-east-2.amazonaws.com/user-6787893423126f0012a92ed6/file_1741258763688_image%20%2825%29.png",
"title": " Software Development Test Engineer WBC Community Test Engineer"
}
},
"error": false,
"message": "Comment added successfully"
}