v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
📸 Social Media

Add comment

The API endpoint allows users to add a comment to a specific post based on the postId provided in the path variable.

When accessing this endpoint and providing a valid postId as a parameter, users can submit their comments to be associated with that particular post.

post/social-media/comments/post/{postId}

Request body

contentstring

Example request

{
  "content": "My first comment"
}

Response

Add comment

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "649769d2b883005dbdcc3292",
    "author": "6497369d3e2615fb255a947d",
    "content": "My first comment",
    "createdAt": "2023-06-24T22:10:26.895Z",
    "postId": "649736ac3e2615fb255a948b",
    "updatedAt": "2023-06-24T22:10:26.895Z"
  },
  "message": "Comment added successfully",
  "statusCode": 201,
  "success": true
}