Posts Application

This section describes the API endpoints for managing posts.

Base URL: /

Authentication:

Most API calls require authorization with a valid access token. You can obtain an access token by logging in with a username and password (refer to Accounts section).

Retrieve all Posts List (paginated)

{ "count": integer, "next": "null|string", # Added for pagination links (if applicable) "previous": "null|string", # Added for pagination links (if applicable) "posts": [ # List of posts ] }

Create Post

{ "title": "string", "content": "string" }
{ "created_post": { "code": "string", "target": "string", "title": "string", "content": "string", "author": { "full_name": "string", "username": "string", "bio": "null|string", "profile_image": "null|string", "following_count": integer, "follower_count": integer, "is_follow": boolean, "is_verify": boolean }, "created": "string (date-time)", "updated": "null|string (date-time)", "like_count": integer, "is_like": boolean, "is_save": boolean, "status": "string", "views": integer, "comment_count": integer } }

Update Post

{ "title": "string", "content": "string" }
{ "message": "Post updated successfully" }

Delete Post

{ "message": "Post deleted successfully" }

Save Post

{ "message": "You are now save/unsave <post_title>." (depending on action) }

Like Post

{ "message": "You are now like/unlike <post_title>." (depending on action) }

Get Post by Code

{ "post": { "code": "string", "target": "/post/9Qejlp8IXpe", "title": "string", "content": "string", "author": { "full_name": "string", "username": "string", "bio": "null|string", "profile_image": "null|string", "following_count": integer, "follower_count": integer, "is_follow": boolean, "is_verify": boolean }, "created": "string (date-time)", "updated": "null|string (date-time)", "like_count": integer, "is_like": boolean, "is_save": boolean, "status": "string", "views": integer, "comment_count": integer }

Get Liked Posts

{ "posts": [ # List of posts liked by the current user ] }

Get Saved Posts

{ "posts": [ # List of posts saved by the current user ] }