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

Post related endpoints

Ramza edited this page Feb 1, 2024 · 3 revisions

Create a new Post

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

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

Expected Parameters:

  • Title
  • Description
  • Content

Returns:

  • ID

Get popular posts of today

GET /api/v1/posts/today

Returns an array of:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Get popular posts of last week

GET /api/v1/posts/week

Returns an array of:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Get popular posts of last month

GET /api/v1/posts/month

Returns an array of:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Get popular posts of all time

GET /api/v1/posts/alltime

Returns an array of:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Get post by ID

GET /api/v1/posts/{postid}

Returns:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Get posts by User ID

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

Returns an array of:

  • PostID
  • OwnerID
  • Title
  • Description
  • Content
  • CreationDate
  • Likes

Update title

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

PUT /api/v1/users/{userid}/posts/{postid}/title

Expected parameters:

  • Title

Update description

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

PUT /api/v1/users/{userid}/posts/{postid}/description

Expected parameters:

  • Description

Update content

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

PUT /api/v1/users/{userid}/posts/{postid}/content

Expected parameters:

  • Content

Delete

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

DELETE /api/v1/users/{userid}/posts/{postid}

Add like

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

POST /api/v1/users/{userid}/posts/{postid}/likes

Delete like

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

DELETE /api/v1/users/{userid}/posts/{postid}/likes