Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Comment related endpoints

Ramza edited this page Feb 1, 2024 · 2 revisions

Create a new Comment

Requires Authorization Bearer header with a valid JWT token corresponding to the userid.

POST /api/v1/users/{userid}/comments

Expected Parameters:

  • Content

Returns:

  • ID

Get by Comment ID

GET /api/v1/comments/{commentid}

Returns:

  • ID
  • PostID
  • UserID
  • Content
  • Likes

Get by User ID

GET /api/v1/users/{userid}/comments

Returns an array of:

  • ID
  • PostID
  • UserID
  • Content
  • Likes

Get by Post ID

GET /api/v1/posts/{postid}/comments

Returns an array of:

  • ID
  • PostID
  • UserID
  • Content
  • Likes

Update content

Requires Authorization Bearer header with a valid JWT token corresponding to the userid.

PUT /api/v1/users/{userid}/comments/{commentid}

Expects parameters:

  • Content

Delete

Requires Authorization Bearer header with a valid JWT token corresponding to the userid.

DELETE /api/v1/users/{userid}/comments/{commentid}

Add like

Requires Authorization Bearer header with a valid JWT token corresponding to the userid.

POST /api/v1/users/{userid}/comments/{commentid}/likes

Delete like

Requires Authorization Bearer header with a valid JWT token corresponding to the userid.

DELETE /api/v1/users/{userid}/comments/{commentid}/likes

Clone this wiki locally